Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HTTPClient = &http.Client{ Timeout: 15 * time.Second, } )
Functions ¶
This section is empty.
Types ¶
type Downloader ¶
Downloader will download and cache DPL files in a temp directory.
If HTTP is nil then http.DefaultClient will be used (which has NO timeouts).
See: https://www.treasury.gov/resource-center/sanctions/SDN-List/Pages/sdn_data.aspx
func (*Downloader) GetFiles ¶
func (dl *Downloader) GetFiles(initialDir string, namesAndSources map[string]string) ([]string, error)
GetFiles will download all provided files, return their filepaths, and store them in a temporary directory and an error otherwise.
initialDir is an optional filepath to look for files in before attempting to download.
Callers are expected to cleanup the temp directory.
Click to show internal directories.
Click to hide internal directories.