sanctionsio

package
v0.0.0-...-4eb781d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SourceHMTreasury = "HM TREASURY"

Variables

View Source
var SearchRequestDOBFormat = regexp.MustCompile(`^\d{4}(?:-\d{2}-\d{2}$)?`)

Functions

This section is empty.

Types

type Client

type Client struct {
	*jsonclient.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURL, apiKey string) *Client

NewClient creates a new sanctions.io API client.

func (*Client) Search

func (c *Client) Search(ctx context.Context, req *SearchRequest) (res *SearchResponse, err error)

Search queries the API with options for Name, Sources and Date of Birth

type SearchRequest

type SearchRequest struct {
	Name        string
	Sources     []string
	DateOfBirth *string
}

func (SearchRequest) URLValues

func (r SearchRequest) URLValues() url.Values

type SearchResponse

type SearchResponse struct {
	Count    int                     `json:"count"`
	Next     *string                 `json:"next"`
	Previous *string                 `json:"previous"`
	Results  []*SearchResponseResult `json:"results"`
}

func (*SearchResponse) HasMatches

func (r *SearchResponse) HasMatches() bool

type SearchResponseResult

type SearchResponseResult struct {
	Name         string `json:"name" bson:"name"`
	Source       string `json:"source" bson:"source"`
	EntityNumber int    `json:"entity_number" bson:"entity_number"`
	Type         string `json:"type" bson:"type"`
	StartDate    string `json:"start_date" bson:"start_date"`

	Addresses     []string `json:"addresses,omitempty" bson:"addresses,omitempty"`
	Remarks       *string  `json:"remarks,omitempty" bson:"remarks,omitempty"`
	Nationalities []string `json:"nationalities,omitempty" bson:"nationalities,omitempty"`
	DatesOfBirth  []string `json:"dates_of_birth,omitempty" bson:"dates_of_birth,omitempty"`
	PlacesOfBirth []string `json:"places_of_birth,omitempty" bson:"places_of_birth,omitempty"`
	Regime        *string  `json:"regime,omitempty" bson:"regime,omitempty"`
	NINumbers     []string `json:"ni_numbers,omitempty" bson:"ni_numbers,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL