Documentation
¶
Overview ¶
Package amf holds the connectors of the lists the Autorité des marchés financiers publishes daily on data.gouv.fr under the Licence Ouverte 2.0 (docs/sources.md): the blacklist, and the white lists of digital asset service providers (PSAN) and of offers in goods (biens divers). Each list is its own source, with its own snapshot.
Each snapshot row is one key of an entry, looked up by its normalised host, address, phone number or SIREN. Free-text names of the blacklist, which may name natural persons, are left out: no input kind matches them.
Index ¶
Constants ¶
const ( // ColumnAMFNumber is the AMF number of the authorisation or offer // ("E2020-001", "D-14-01"), "N/A - Passeport" for a provider passported // from another EU country. ColumnAMFNumber = "no_amf" // ColumnName is the provider or offer name, as the AMF lists it. ColumnName = "name" )
Columns of a white list row, after the common ones.
const ( // ColumnCountry is the country of the provider's head office, in French. ColumnCountry = "country" // ColumnAuthorisation is the kind of authorisation ("Enregistrement", // "Agrément MICA", "Agrément Pacte"). ColumnAuthorisation = "authorisation" // ColumnStatus is "Agréé" or "Radié". ColumnStatus = "status" // ColumnAuthorisedFrom is the start date of the authorisation, AAAA-MM-JJ. ColumnAuthorisedFrom = "authorised_from" // ColumnAuthorisedUntil is its end date, "" while it runs. ColumnAuthorisedUntil = "authorised_until" )
Columns of a PSAN row, after the common ones.
const BlacklistDatasetURL = "https://www.data.gouv.fr/api/1/datasets/641d5dab1d84b530f7720b08/"
BlacklistDatasetURL is the data.gouv.fr API page of the blacklist dataset.
const BlacklistSource domain.Source = "AMF"
BlacklistSource is the name of the AMF blacklist, as shown to users.
const ColumnRegisteredOn = "registered_on"
ColumnRegisteredOn is the registration date of an offer, AAAA-MM-JJ.
const OffersDatasetURL = "https://www.data.gouv.fr/api/1/datasets/65709c9cae162fbc34e7ec05/"
OffersDatasetURL is the data.gouv.fr API page of the biens divers dataset.
const OffersSource domain.Source = "AMF biens divers"
OffersSource is the name of the AMF white list of offers in goods (biens divers: wine, cattle, trees…), as shown to users.
const PSANDatasetURL = "https://www.data.gouv.fr/api/1/datasets/653135cf052c9a87787413c2/"
PSANDatasetURL is the data.gouv.fr API page of the PSAN dataset.
const PSANSource domain.Source = "AMF PSAN"
PSANSource is the name of the AMF white list of digital asset service providers (PSAN and MiCA providers), as shown to users.
Variables ¶
var ErrFormat = errors.New("unexpected AMF file format")
ErrFormat means a file is not laid out as docs/sources.md records it. Errors never quote a value of the file: it may hold an address.
var ErrResource = errors.New("no single AMF CSV resource")
ErrResource means the dataset metadata does not name exactly one CSV file.
Functions ¶
func Hosts ¶
func Hosts() []string
Hosts returns the hosts a Fetcher reaches, for the HTTP client allowlist: the data.gouv.fr API and the object store that serves the files.
func ParseBlacklist ¶ added in v0.16.0
ParseBlacklist reads the published CSV file into a snapshot, one row per site or address. Free-text names are left out. A file that departs from the recorded format is rejected with ErrFormat rather than half read.
func ParseOffers ¶ added in v0.16.0
ParseOffers reads the published CSV file into a snapshot, one row per site and phone number of a registered offer. An offer with neither gives no row.
func ParsePSAN ¶ added in v0.16.0
ParsePSAN reads the published CSV file into a snapshot, one row per key of a provider's authorisation: each site, address, phone number and, for a French provider, SIREN. The file has one record per activity; records that give the same row merge. A contact page in the e-mail column and a foreign registry number are not keys and are left out.
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher downloads and parses one AMF list. It implements app.SourceFetcher.
func NewBlacklist ¶ added in v0.16.0
NewBlacklist returns the Fetcher of the blacklist, which reads the dataset metadata at datasetURL, BlacklistDatasetURL in production, through client.
func NewOffers ¶ added in v0.16.0
NewOffers returns the Fetcher of the biens divers white list, which reads the dataset metadata at datasetURL, OffersDatasetURL in production, through client.
func NewPSAN ¶ added in v0.16.0
NewPSAN returns the Fetcher of the PSAN white list, which reads the dataset metadata at datasetURL, PSANDatasetURL 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.