Embargo | Golang SDK
The Pangea Embargo API lets developers quickly check IPs and country codes against known sanction and trade embargo lists.
Check IP
func (e *embargo) IPCheck(ctx context.Context, input *IPCheckRequest) (*pangea.PangeaResponse[CheckResult], error)Check this IP against known sanction and trade embargo lists.
input := &embargo.IPCheckInput{
IP: pangea.String("190.6.64.94"),
}
checkResponse, err := embargocli.IPCheck(ctx, input)
ISO Code Check
func (e *embargo) ISOCheck(ctx context.Context, input *ISOCheckRequest) (*pangea.PangeaResponse[CheckResult], error)Check this country against known sanction and trade embargo lists.
input := &embargo.ISOCheckInput{
ISOCode: pangea.String("CU"),
}
checkResponse, err := embargocli.ISOCheck(ctx, input)
Type CheckResult
type CheckResult structtype CheckResult struct {
Count int `json:"count"`
Sanctions []Sanction `json:"sanctions"`
}
Type Client
type Client interfacetype Client interface {
IPCheck(ctx context.Context, req *IPCheckRequest) (*pangea.PangeaResponse[CheckResult], error)
ISOCheck(ctx context.Context, req *ISOCheckRequest) (*pangea.PangeaResponse[CheckResult], error)
// Base service methods
pangea.BaseServicer
}
Type IPCheckRequest
type IPCheckRequest structtype IPCheckRequest struct {
pangea.BaseRequest
// Check this IP against the enabled embargo lists.
// Accepts both IPV4 and IPV6 strings.
IP string `json:"ip,omitempty"`
}
Type ISOCheckRequest
type ISOCheckRequest structtype ISOCheckRequest struct {
pangea.BaseRequest
// Check this two character country ISO-code against the enabled embargo lists.
ISOCode string `json:"iso_code,omitempty"`
}
Type Sanction
type Sanction structtype Sanction struct {
EmbargoedCountryISOCode string `json:"embargoed_country_iso_code"`
IssuingCountry string `json:"issuing_country"`
ListName string `json:"list_name"`
EmbargoedCountryName string `json:"embargoed_country_name"`
Annotations map[string]interface{} `json:"annotations"`
}
Type embargo
type embargo structtype embargo struct {
pangea.BaseService
}