Documentation
¶
Overview ¶
Package amf is the connector of the AMF blacklist: the CSV file the Autorité des marchés financiers publishes daily on data.gouv.fr under the Licence Ouverte 2.0 (docs/sources.md).
Each snapshot row is one site or address, looked up by its normalised host or address. Free-text names, which may name natural persons, are left out: no input kind matches them.
Index ¶
Constants ¶
const ( // ColumnKind is "domain" or "email". ColumnKind = "kind" // ColumnKey is the normalised host or address the entry is looked up by. ColumnKey = "key" // ColumnPath is the path and query of a site entry that targets one // page, "" when it targets the whole site. ColumnPath = "path" // ColumnEntry is the entry as the AMF lists it. ColumnEntry = "entry" // ColumnCategories are the AMF categories, separated by "|". ColumnCategories = "categories" // ColumnListedOn is the listing date, AAAA-MM-JJ. ColumnListedOn = "listed_on" )
Columns of a snapshot row, in order.
const DatasetURL = "https://www.data.gouv.fr/api/1/datasets/641d5dab1d84b530f7720b08/"
DatasetURL is the data.gouv.fr API page of the dataset, which names the current file: its URL is dated and changes with every export.
const Source domain.Source = "AMF"
Source is the name of the AMF blacklist, as shown to users.
Variables ¶
var ErrFormat = errors.New("unexpected AMF file format")
ErrFormat means the file is not laid out as docs/sources.md records it.
var ErrResource = errors.New("no single AMF CSV resource")
ErrResource means the dataset metadata does not name exactly one CSV file.
Functions ¶
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher downloads and parses the AMF blacklist. It implements app.SourceFetcher.
func NewFetcher ¶
NewFetcher returns a Fetcher that reads the dataset metadata at datasetURL, DatasetURL in production, through client.
func (*Fetcher) Fetch ¶
Fetch resolves the current file from the dataset metadata, downloads it and parses it.
func (*Fetcher) Spec ¶
func (f *Fetcher) Spec() domain.SnapshotSpec
Spec declares the snapshot columns and the least number of rows.