Documentation
¶
Index ¶
- Constants
- Variables
- func Download(logger log.Logger, initialDir string) (string, error)
- func DownloadEU(logger log.Logger, initialDir string) (string, error)
- func DownloadUKCSL(logger log.Logger, initialDir string) (string, error)
- func DownloadUKSanctionsList(logger log.Logger, initialDir string) (string, error)
- func ParseEU(r io.Reader) ([]*EUCSLRecord, EUCSL, error)
- func ParseUKCSL(r io.Reader) ([]*UKCSLRecord, UKCSL, error)
- func ReadEUFile(path string) ([]*EUCSLRecord, EUCSL, error)
- func ReadUKCSLFile(path string) ([]*UKCSLRecord, UKCSL, error)
- func ReadUKSanctionsListFile(path string) ([]*UKSanctionsListRecord, UKSanctionsListMap, error)
- type Address
- type BirthDate
- type CAP
- type CMIC
- type CSL
- type DTC
- type EL
- type EUCSL
- type EUCSLRecord
- type EUCSLRow
- type Entity
- type FSE
- type ISN
- type Identification
- type MEU
- type NS_MBS
- type NameAlias
- type PLC
- type Regulation
- type SSI
- type SubjectType
- type UKCSL
- type UKCSLRecord
- type UKSLEntityType
- type UKSanctionsListMap
- type UKSanctionsListRecord
- type UVL
Constants ¶
const ( SourceIdx = iota EntityNumberIdx TypeIdx ProgramsIdx NameIdx TitleIdx AddressesIdx FRNoticeIdx // Federal Register Notice StartDateIdx EndDateIdx StandardOrderIdx LicenseRequirementIdx LicensePolicyIdx CallSignIdx VesselTypeIdx GrossTonnageIdx GrossRegisteredTonnageIdx VesselFlagIdx VesselOwnerIdx RemarksIdx SourceListURLIdx AltNamesIdx CitizenshipsIdx DatesOfBirthIdx NationalitiesIdx PlacesOfBirthIdx SourceInformationURLIdx IDsIdx )
This is the order of the columns in the CSL Source: https://legacy.trade.gov/CSL_Download_Instructions.pdf
const ( FileGenerationDateIdx = 0 EntityLogicalIdx = 1 ReferenceNumberIdx = 2 EntityRemarkIdx = 6 EntitySubjectTypeIdx = 8 EntityRegulationPublicationURLIdx = 15 NameAliasWholeNameIdx = 19 NameAliasTitleIdx = 22 AddressCityIdx = 34 AddressStreetIdx = 35 AddressPoBoxIdx = 36 AddressZipCodeIdx = 37 AddressCountryDescriptionIdx = 43 BirthDateIdx = 54 BirthDateCityIdx = 65 BirthDateCountryIdx = 67 IdentificationValidFromIdx = 86 IdentificationValidToIdx = 87 )
header indicies
const ( UKNameIdx = 0 UKNameTwoIdx = 1 UKNameThreeIdx = 2 UKNameFourIdx = 3 UKNameFiveIdx = 4 UKTitleIdx = 6 DOBhIdx = 10 TownOfBirthIdx = 11 CountryOfBirthIdx = 12 UKNationalitiesIdx = 13 AddressOneIdx = 19 AddressTwoIdx = 20 AddressThreeIdx = 21 AddressFourIdx = 22 AddressFiveIdx = 23 AddressSixIdx = 24 PostalCodeIdx = 25 CountryIdx = 26 OtherInfoIdx = 27 GroupTypeIdx = 28 ListedDateIdx = 32 UKSancListDateIdx = 33 LastUpdatedIdx = 34 GroupdIdx = 35 )
Indices we care about for UK - CSL row data
const ( UKSL_LastUpdatedIdx = 0 UKSL_UniqueIDIdx = 1 UKSL_OFSI_GroupIDIdx = 2 // this is the group ID from the consolidated sanctions list UKSL_UNReferenceNumberIdx = 3 // Name info UKSL_Name6Idx = 4 UKSL_Name1Idx = 5 UKSL_Name2Idx = 6 UKSL_Name3Idx = 7 UKSL_Name4Idx = 8 UKSL_Name5Idx = 9 UKSL_NameTypeIdx = 10 // either Primary Name or Alias UKSL_AliasStrengthIdx = 11 UKSL_TitleIdx = 12 UKSL_NonLatinScriptIdx = 13 UKSL_NonLatinTypeIdx = 14 UKSL_NonLatinLanguageIdx = 15 UKSL_EntityTypeIdx = 17 // individual, entity, ship UKSL_OtherInfoIdx = 20 // Address Info UKSL_AddressLine1Idx = 22 UKSL_AddressLine2Idx = 23 UKSL_AddressLine3Idx = 24 UKSL_AddressLine4Idx = 25 UKSL_AddressLine5Idx = 26 UKSL_AddressLine6Idx = 27 UKSL_PostalCodeIdx = 28 UKSL_AddressCountryIdx = 29 UKSL_CountryOfBirthIdx = 43 )
Variables ¶
var EntityEnumMap map[UKSLEntityType]string = map[UKSLEntityType]string{
UKSLIndividual: "Individual",
UKSLEntity: "Entity",
UKSLShip: "Ship",
}
var EntityStringMap map[string]UKSLEntityType = map[string]UKSLEntityType{ "Individual": UKSLIndividual, "Entity": UKSLEntity, "Ship": UKSLShip, }
Functions ¶
func DownloadEU ¶ added in v0.24.0
func DownloadUKCSL ¶ added in v0.24.0
func DownloadUKSanctionsList ¶ added in v0.24.0
func ParseUKCSL ¶ added in v0.24.0
func ParseUKCSL(r io.Reader) ([]*UKCSLRecord, UKCSL, error)
func ReadEUFile ¶ added in v0.24.0
func ReadEUFile(path string) ([]*EUCSLRecord, EUCSL, error)
func ReadUKCSLFile ¶ added in v0.24.0
func ReadUKCSLFile(path string) ([]*UKCSLRecord, UKCSL, error)
func ReadUKSanctionsListFile ¶ added in v0.24.0
func ReadUKSanctionsListFile(path string) ([]*UKSanctionsListRecord, UKSanctionsListMap, error)
Types ¶
type Address ¶ added in v0.24.0
type Address struct { City string `json:"city"` Street string `json:"street"` PoBox string `json:"poBox"` ZipCode string `json:"zipCode"` // Region string // Place string // AsAtListingTime string // ContactInfo string // CountryIso2code string CountryDescription string `json:"countryDescription"` }
type BirthDate ¶ added in v0.24.0
type BirthDate struct { BirthDate string // keep // Day int64 // Month int64 // Year int64 // YearRangeFrom string // YearRangeTo string // Circa string // CaldendarType string // ZipCode string // Region string // Place string City string `json:"city"` // CountryIso2code string CountryDescription string `json:"countryDescription"` }
type CAP ¶ added in v0.23.0
type CAP struct { EntityID string `json:"entityID"` EntityNumber string `json:"entityNumber"` Type string `json:"type"` Programs []string `json:"programs"` Name string `json:"name"` Addresses []string `json:"addresses"` Remarks []string `json:"remarks"` SourceListURL string `json:"sourceListURL,omitempty"` AlternateNames []string `json:"alternamteNames,omitempty"` SourceInfoURL string `json:"sourceInfoURL"` IDs []string `json:"IDs"` }
type CMIC ¶ added in v0.23.0
type CMIC struct { EntityID string `json:"entityID"` EntityNumber string `json:"entityNumber"` Type string `json:"type"` Programs []string `json:"programs"` Name string `json:"name"` Addresses []string `json:"addresses"` Remarks []string `json:"remarks,omitempty"` SourceListURL string `json:"sourceListURL"` AlternateNames []string `json:"alternateNames"` SourceInfoURL string `json:"sourceInfoURL"` IDs []string `json:"IDs"` }
type CSL ¶
type CSL struct { ELs []*EL // Entity List – Bureau of Industry and Security MEUs []*MEU // Military End User List SSIs []*SSI // Sectoral Sanctions Identifications List (SSI) - Treasury Department UVLs []*UVL // Unverified List – Bureau of Industry and Security FSEs []*FSE // Foreign Sanctions Evaders (FSE) - Treasury Department ISNs []*ISN // Nonproliferation Sanctions (ISN) - State Department PLCs []*PLC // Palestinian Legislative Council List (PLC) - Treasury Department CAPs []*CAP // CAPTA (formerly Foreign Financial Institutions Subject to Part 561 - Treasury Department) DTCs []*DTC // ITAR Debarred (DTC) - State Department CMICs []*CMIC // Non-SDN Chinese Military-Industrial Complex Companies List (CMIC) - Treasury Department NS_MBSs []*NS_MBS // Non-SDN Menu-Based Sanctions List (NS-MBS List) - Treasury Department }
CSL contains each record from the Consolidate Screening List, broken down by the record's original source
type EL ¶
type EL struct { // ID is the unique identifier for the entity ID string `json:"id"` // Name is the primary name of the entity Name string `json:"name"` // AlternateNames is a list of aliases associated with the entity AlternateNames []string `json:"alternateNames"` // Addresses is a list of known addresses associated with the entity Addresses []string `json:"addresses"` // StartDate is the effective date StartDate string `json:"startDate"` // LicenseRequirement specifies the license requirements that it imposes on each listed person LicenseRequirement string `json:"licenseRequirement"` // LicensePolicy is the policy with which BIS reviews the requirements set forth in License Requirements LicensePolicy string `json:"licensePolicy"` // FRNotice identifies the notice in the Federal Register FRNotice string `json:"FRNotice"` // SourceListURL is a link to the official SSI list SourceListURL string `json:"sourceListURL"` // SourceInfoURL is a link to information about the list SourceInfoURL string `json:"sourceInfoURL"` }
EL is the Entity List (EL) - Bureau of Industry and Security
type EUCSL ¶ added in v0.24.0
type EUCSL map[int]*EUCSLRecord
struct to hold the rows from the csv data before merge
type EUCSLRecord ¶ added in v0.24.0
type EUCSLRecord struct { FileGenerationDate string `json:"fileGenerationDate"` EntityLogicalID int `json:"entityLogicalId"` EntityRemark string `json:"entityRemark"` EntitySubjectType string `json:"entitySubjectType"` EntityPublicationURL string `json:"entityPublicationURL"` EntityReferenceNumber string `json:"entityReferenceNumber"` NameAliasWholeNames []string `json:"nameAliasWholeNames"` NameAliasTitles []string `json:"nameAliasTitles"` AddressCities []string `json:"addressCities"` AddressStreets []string `json:"addressStreets"` AddressPoBoxes []string `json:"addressPoBoxs"` AddressZipCodes []string `json:"addressZipCodes"` AddressCountryDescriptions []string `json:"addressCountryDescriptions"` BirthDates []string `json:"birthDates"` BirthCities []string `json:"birthCities"` BirthCountries []string `json:"birthCountries"` ValidFromTo map[string]string `json:"validFromTo"` }
type EUCSLRow ¶ added in v0.24.0
type EUCSLRow struct { FileGenerationDate string `json:"fileGenerationDate"` Entity *Entity `json:"entity"` NameAliases []*NameAlias `json:"nameAliases"` Addresses []*Address `json:"addresses"` BirthDates []*BirthDate `json:"birthDates"` Identifications []*Identification `json:"identifications"` }
below is the original struct used to parse the document fields commented out are not parsed this was refactored to be a flatter structure but is left in for documentation use the EUCSLRecord struct above
type Entity ¶ added in v0.24.0
type Entity struct { LogicalID int `json:"logicalId"` ReferenceNumber string `json:"referenceNumber"` // UnitiedNationsID string // DesignationDate string // DesignationDetails string Remark string `json:"remark"` SubjectType *SubjectType `json:"subjectType"` Regulation *Regulation `json:"regulation"` }
type FSE ¶ added in v0.23.0
type FSE struct { EntityID string `json:"entityID"` EntityNumber string `json:"entityNumber"` Type string `json:"type"` Programs []string `json:"programs"` Name string `json:"name"` Addresses []string `json:"addresses,omitempty"` SourceListURL string `json:"sourceListURL"` Citizenships string `json:"citizenships,omitempty"` DatesOfBirth string `json:"datesOfBirth"` SourceInfoURL string `json:"sourceInfoURL"` IDs []string `json:"IDs"` }
type ISN ¶ added in v0.23.0
type ISN struct { EntityID string `json:"entityID"` Programs []string `json:"programs"` Name string `json:"name"` FederalRegisterNotice string `json:"federalRegisterNotice"` StartDate string `json:"startDate"` Remarks []string `json:"remarks,omitempty"` SourceListURL string `json:"sourceListURL"` AlternateNames []string `json:"alternateNames,omitempty"` SourceInfoURL string `json:"sourceInfoURL"` }
type Identification ¶ added in v0.24.0
type Identification struct { // Regulation *Regulation // Number int64 // KnownExpired bool // KnownFalse bool // ReportedLost bool // RevokedByIssuer bool // LogicalID int64 // Diplomatic string // IssuedBy string // IssuedDate string ValidFrom string `json:"validFrom"` ValidTo string `json:"validTo"` }
type NS_MBS ¶ added in v0.23.0
type NS_MBS struct { EntityID string `json:"entityID"` EntityNumber string `json:"entityNumber"` Type string `json:"type"` Programs []string `json:"programs"` Name string `json:"name"` Addresses []string `json:"addresses"` Remarks []string `json:"remarks,omitempty"` AlternateNames []string `json:"alternateNames,omitempty"` SourceInfoURL string `json:"sourceInfoURL"` IDs []string `json:"IDs"` }
type PLC ¶ added in v0.23.0
type PLC struct { EntityID string `json:"entityID"` EntityNumber string `json:"entityNumber"` Type string `json:"type"` Programs []string `json:"programs"` Name string `json:"name"` Addresses []string `json:"addresses,omitempty"` Remarks string `json:"remarks"` SourceListURL string `json:"sourceListURL"` AlternateNames []string `json:"alternateNames,omitempty"` DatesOfBirth string `json:"datesOfBirth,omitempty"` PlacesOfBirth string `json:"placesOfBirth,omitempty"` SourceInfoURL string `json:"sourceInfoURL"` }
type Regulation ¶ added in v0.24.0
type Regulation struct { // Type string // OrganizationType string // PublicationDate string // EntryInfoForceDate string // NumberTitle string // Programme string PublicationURL string `json:"publicationURL"` }
type SSI ¶
type SSI struct { // EntityID (ent_num) is the unique record identifier/unique listing identifier EntityID string `json:"entityID"` // Type is the entity type (e.g. individual, vessel, aircraft, etc) Type string `json:"type"` // Programs is the list of sanctions program for which the entity is flagged Programs []string `json:"programs"` // Name is the entity's name (e.g. given name for individual, company name, etc.) Name string `json:"name"` // Addresses is a list of known addresses associated with the entity Addresses []string `json:"addresses"` // Remarks is used to provide additional details for the entity Remarks []string `json:"remarks"` // AlternateNames is a list of aliases associated with the entity AlternateNames []string `json:"alternateNames"` // IDsOnRecord is a list of the forms of identification on file for the entity IDsOnRecord []string `json:"ids"` // SourceListURL is a link to the official SSI list SourceListURL string `json:"sourceListURL"` // SourceInfoURL is a link to information about the list SourceInfoURL string `json:"sourceInfoURL"` }
SSI is the Sectoral Sanctions Identifications List - Treasury Department
type SubjectType ¶ added in v0.24.0
type SubjectType struct { // SingleLetter string ClassificationCode string `json:"classificationCode"` }
type UKCSL ¶ added in v0.24.0
type UKCSL map[int]*UKCSLRecord
type UKCSLRecord ¶ added in v0.24.0
type UKCSLRecord struct { Names []string `json:"names"` Titles []string `json:"titles"` DatesOfBirth []string `json:"datesOfBirth"` TownsOfBirth []string `json:"townsOfBirth"` CountriesOfBirth []string `json:"countriesOfBirth"` Nationalities []string `json:"nationalities"` Addresses []string `json:"addresses"` PostalCodes []string `json:"postalCodes"` Countries []string `json:"countries"` OtherInfos []string `json:"otherInfo"` GroupType string `json:"groupType"` ListedDates []string `json:"listedDate"` SanctionListDates []string `json:"sanctionListDate"` LastUpdates []string `json:"lastUpdated"` GroupID int `json:"groupId"` }
UK is the UK Consolidated List of Financial Sanctions Targets
type UKSLEntityType ¶ added in v0.24.0
type UKSLEntityType string
const ( Undefined UKSLEntityType = "" UKSLIndividual UKSLEntityType = "Individual" UKSLEntity UKSLEntityType = "Entity" UKSLShip UKSLEntityType = "Ship" )
func (UKSLEntityType) String ¶ added in v0.24.0
func (et UKSLEntityType) String() string
type UKSanctionsListMap ¶ added in v0.24.0
type UKSanctionsListMap map[string]*UKSanctionsListRecord