Documentation
¶
Index ¶
- func CslRecords(logger log.Logger, initialDir string) (*csl.CSL, error)
- func DplRecords(logger log.Logger, initialDir string) ([]*dpl.DPL, error)
- func EuCSLRecords(logger log.Logger, initialDir string) ([]*csl.EUCSLRecord, error)
- func OfacRecords(logger log.Logger, initialDir string) (*ofac.Results, error)
- func Search(logger log.Logger, searcher *Searcher) http.HandlerFunc
- func UkCSLRecords(logger log.Logger, initialDir string) ([]*csl.UKCSLRecord, error)
- func UkSanctionsListRecords(logger log.Logger, initialDir string) ([]*csl.UKSanctionsListRecord, error)
- type Address
- type Alt
- type DP
- type DownloadStats
- type Name
- type Pipeliner
- type Result
- type SDN
- type SearchResponse
- type Searcher
- func (s *Searcher) FilterCountries(name string) []*Address
- func (s *Searcher) FindAddresses(limit int, id string) []*ofac.Address
- func (s *Searcher) FindAlts(limit int, id string) []*ofac.AlternateIdentity
- func (s *Searcher) FindSDN(entityID string) *ofac.SDN
- func (s *Searcher) FindSDNsByRemarksID(limit int, id string) []*SDN
- func (s *Searcher) TopAddresses(limit int, minMatch float64, reqAddress string) []Address
- func (s *Searcher) TopAltNames(limit int, minMatch float64, alt string) []Alt
- func (s *Searcher) TopBISEntities(limit int, minMatch float64, name string) []*Result[csl.EL]
- func (s *Searcher) TopCAPs(limit int, minMatch float64, name string) []*Result[csl.CAP]
- func (s *Searcher) TopCMICs(limit int, minMatch float64, name string) []*Result[csl.CMIC]
- func (s *Searcher) TopDPs(limit int, minMatch float64, name string) []DP
- func (s *Searcher) TopDTCs(limit int, minMatch float64, name string) []*Result[csl.DTC]
- func (s *Searcher) TopEUCSL(limit int, minMatch float64, name string) []*Result[csl.EUCSLRecord]
- func (s *Searcher) TopFSEs(limit int, minMatch float64, name string) []*Result[csl.FSE]
- func (s *Searcher) TopISNs(limit int, minMatch float64, name string) []*Result[csl.ISN]
- func (s *Searcher) TopMEUs(limit int, minMatch float64, name string) []*Result[csl.MEU]
- func (s *Searcher) TopNS_MBS(limit int, minMatch float64, name string) []*Result[csl.NS_MBS]
- func (s *Searcher) TopPLCs(limit int, minMatch float64, name string) []*Result[csl.PLC]
- func (s *Searcher) TopSDNs(limit int, minMatch float64, name string, keepSDN func(*SDN) bool) []*SDN
- func (s *Searcher) TopSSIs(limit int, minMatch float64, name string) []*Result[csl.SSI]
- func (s *Searcher) TopUKCSL(limit int, minMatch float64, name string) []*Result[csl.UKCSLRecord]
- func (s *Searcher) TopUKSanctionsList(limit int, minMatch float64, name string) []*Result[csl.UKSanctionsListRecord]
- func (s *Searcher) TopUVLs(limit int, minMatch float64, name string) []*Result[csl.UVL]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CslRecords ¶ added in v0.27.2
func DplRecords ¶ added in v0.27.2
func EuCSLRecords ¶ added in v0.27.2
func OfacRecords ¶ added in v0.27.2
func UkCSLRecords ¶ added in v0.27.2
func UkSanctionsListRecords ¶ added in v0.27.2
Types ¶
type Address ¶
Address is ofac.Address wrapped with precomputed search metadata
func PrecomputeAddresses ¶ added in v0.27.2
func TopAddressesFn ¶
func TopAddressesFn(limit int, minMatch float64, addresses []*Address, compare func(*Address) *item) []Address
TopAddressesFn performs a ranked search over an arbitrary set of Address fields.
compare takes an Address (from s.Addresses) and is expected to extract some property to be compared against a captured parameter (in a closure calling compare) to return an *item for final sorting. See searchByAddress in search_handlers.go for an example
func (Address) MarshalJSON ¶
MarshalJSON is a custom method for marshaling a SDN Address search result
type Alt ¶
type Alt struct { AlternateIdentity *ofac.AlternateIdentity // contains filtered or unexported fields }
Alt is an ofac.AlternateIdentity wrapped with precomputed search metadata
func PrecomputeAlts ¶ added in v0.27.2
func PrecomputeAlts(alts []*ofac.AlternateIdentity, pipe *Pipeliner) []*Alt
func (Alt) MarshalJSON ¶
MarshalJSON is a custom method for marshaling a SDN Alternate Identity search result
type DP ¶
DP is a BIS Denied Person wrapped with precomputed search metadata
func (DP) MarshalJSON ¶
MarshalJSON is a custom method for marshaling a BIS Denied Person (DP)
type DownloadStats ¶
type DownloadStats struct { // US Office of Foreign Assets Control (OFAC) SDNs int `json:"SDNs"` Alts int `json:"altNames"` Addresses int `json:"addresses"` // US Bureau of Industry and Security (BIS) DeniedPersons int `json:"deniedPersons"` // Consolidated Screening List (CSL) BISEntities int `json:"bisEntities"` MilitaryEndUsers int `json:"militaryEndUsers"` SectoralSanctions int `json:"sectoralSanctions"` Unverified int `json:"unverifiedCSL"` NonProliferationSanctions int `json:"nonProliferationSanctions"` ForeignSanctionsEvaders int `json:"foreignSanctionsEvaders"` PalestinianLegislativeCouncil int `json:"palestinianLegislativeCouncil"` CAPTA int `json:"CAPTA"` ITARDebarred int `json:"ITARDebarred"` ChineseMilitaryIndustrialComplex int `json:"chineseMilitaryIndustrialComplex"` NonSDNMenuBasedSanctions int `json:"nonSDNMenuBasedSanctions"` // EU Consolidated Sanctions List EUCSL int `json:"europeanSanctionsList"` // UK Consolidated Sanctions List UKCSL int `json:"ukConsolidatedSanctionsList"` // UK Sanctions List UKSanctionsList int `json:"ukSanctionsList"` Errors []error `json:"-"` RefreshedAt time.Time `json:"timestamp"` }
DownloadStats holds counts for each type of list data parsed from files and a timestamp of when the download happened.
func (*DownloadStats) Error ¶
func (ss *DownloadStats) Error() string
func (*DownloadStats) MarshalJSON ¶
func (ss *DownloadStats) MarshalJSON() ([]byte, error)
type Name ¶
type Name struct { // Original is the initial value and MUST not be changed by any pipeline step. Original string // Processed is the mutable value that each pipeline step can optionally // replace and is read as the input to each step. Processed string // contains filtered or unexported fields }
Name represents an individual or entity name to be processed for search.
type Pipeliner ¶
type Pipeliner struct {
// contains filtered or unexported fields
}
func NewPipeliner ¶
type Result ¶
type Result[T any] struct { Data T // contains filtered or unexported fields }
func PrecomputeCSLEntities ¶ added in v0.27.2
func (Result[T]) MarshalJSON ¶
type SDN ¶
SDN is ofac.SDN wrapped with precomputed search metadata
func PrecomputeSDNs ¶ added in v0.27.2
func (SDN) MarshalJSON ¶
MarshalJSON is a custom method for marshaling a SDN search result
type SearchResponse ¶
type SearchResponse struct { // OFAC SDNs []*SDN `json:"SDNs"` AltNames []Alt `json:"altNames"` Addresses []Address `json:"addresses"` // BIS DeniedPersons []DP `json:"deniedPersons"` // Consolidated Screening List BISEntities []*Result[csl.EL] `json:"bisEntities"` MilitaryEndUsers []*Result[csl.MEU] `json:"militaryEndUsers"` SectoralSanctions []*Result[csl.SSI] `json:"sectoralSanctions"` Unverified []*Result[csl.UVL] `json:"unverifiedCSL"` NonproliferationSanctions []*Result[csl.ISN] `json:"nonproliferationSanctions"` ForeignSanctionsEvaders []*Result[csl.FSE] `json:"foreignSanctionsEvaders"` PalestinianLegislativeCouncil []*Result[csl.PLC] `json:"palestinianLegislativeCouncil"` CaptaList []*Result[csl.CAP] `json:"captaList"` ITARDebarred []*Result[csl.DTC] `json:"itarDebarred"` NonSDNChineseMilitaryIndustrialComplex []*Result[csl.CMIC] `json:"nonSDNChineseMilitaryIndustrialComplex"` NonSDNMenuBasedSanctionsList []*Result[csl.NS_MBS] `json:"nonSDNMenuBasedSanctionsList"` // EU - Consolidated Sanctions List EUCSL []*Result[csl.EUCSLRecord] `json:"euConsolidatedSanctionsList"` // UK - Consolidated Sanctions List UKCSL []*Result[csl.UKCSLRecord] `json:"ukConsolidatedSanctionsList"` // UK Sanctions List UKSanctionsList []*Result[csl.UKSanctionsListRecord] `json:"ukSanctionsList"` // Metadata RefreshedAt time.Time `json:"refreshedAt"` }
type Searcher ¶
type Searcher struct { // OFAC SDNs []*SDN Addresses []*Address Alts []*Alt // BIS DPs []*DP // US Consolidated Screening List BISEntities []*Result[csl.EL] MilitaryEndUsers []*Result[csl.MEU] SSIs []*Result[csl.SSI] UVLs []*Result[csl.UVL] ISNs []*Result[csl.ISN] FSEs []*Result[csl.FSE] PLCs []*Result[csl.PLC] CAPs []*Result[csl.CAP] DTCs []*Result[csl.DTC] CMICs []*Result[csl.CMIC] NS_MBSs []*Result[csl.NS_MBS] // EU Consolidated List of Sactions EUCSL []*Result[csl.EUCSLRecord] // UK Consolidated List of Sactions - OFSI UKCSL []*Result[csl.UKCSLRecord] // UK Sanctions List UKSanctionsList []*Result[csl.UKSanctionsListRecord] sync.RWMutex // protects all above fields *syncutil.Gate // limits concurrent processing // contains filtered or unexported fields }
Searcher holds precomputed data for each object available to search against. This data comes from various US and EU Federal agencies
func NewSearcher ¶
exposed for testing
func (*Searcher) FilterCountries ¶
FilterCountries returns Addresses that match a given country name.
If name is blank all Addresses are returned.
This filtering ignore case differences, but does require the name matches to the underlying data.
func (*Searcher) FindAddresses ¶
func (*Searcher) FindAlts ¶
func (s *Searcher) FindAlts(limit int, id string) []*ofac.AlternateIdentity
func (*Searcher) FindSDNsByRemarksID ¶
FindSDNsByRemarksID looks for SDN's whose remarks property contains an ID matching what is provided to this function. It's typically used with values assigned by a local government. (National ID, Drivers License, etc)
func (*Searcher) TopAddresses ¶
func (*Searcher) TopAltNames ¶
func (*Searcher) TopBISEntities ¶
TopBISEntities searches BIS Entity List records by name and alias
func (*Searcher) TopCMICs ¶
TopCMICs searches the Non-SDN Chinese Military Industrial Complex list by Name and Alias
func (*Searcher) TopNS_MBS ¶
TopNS_MBS searches the Non-SDN Menu Based Sanctions list by Name and Alias
func (*Searcher) TopPLCs ¶
TopPLCs searches Palestinian Legislative Council records by Name and Alias
func (*Searcher) TopUKSanctionsList ¶
func (s *Searcher) TopUKSanctionsList(limit int, minMatch float64, name string) []*Result[csl.UKSanctionsListRecord]
TopUKSanctionsList searches the UK Sanctions list by Name and Alias
Source Files
¶
- debug_sdn.go
- download.go
- download_handler.go
- download_webhook.go
- filter.go
- http.go
- largest.go
- pipeline.go
- pipeline_company_name_cleanup.go
- pipeline_normalize.go
- pipeline_reorder.go
- pipeline_stopwords.go
- sdn.go
- search.go
- search_eu_csl.go
- search_generic.go
- search_handlers.go
- search_uk_csl.go
- search_us_csl.go
- values.go
- webhook.go