acpr

package
v0.49.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package acpr holds the connector of the blacklist the Autorité de contrôle prudentiel et de résolution and the AMF publish through Assurance Banque Épargne Info Service (docs/sources.md). Its reuse licence is still to be obtained (issue #30): the source stays disabled by default until then.

Each snapshot row is one site or address, keyed as the AMF blacklist keys it, so an entry both lists hold can be reported with both sources. Free-text names and the Dénomination column, which may name natural persons, are left out.

Index

Constants

View Source
const BlacklistSource = signal.ACPRSource

BlacklistSource is the name of the ACPR blacklist, as shown to users.

View Source
const BlacklistURL = "https://www.abe-infoservice.fr/fr/abeis-liste-noire.csv"

BlacklistURL is the published file of the blacklist.

Variables

View Source
var ErrFormat = errors.New("unexpected ACPR file format")

ErrFormat means the file is not laid out as docs/sources.md records it. Errors never quote a value of the file: it may hold an address.

Functions

func BlacklistInfo added in v0.37.0

func BlacklistInfo() domain.SourceInfo

BlacklistInfo describes the ACPR blacklist for GET /v1/sources. It publishes no licence: the source is turned on only once its publisher authorises the reuse (issue #30, docs/sources.md).

func Hosts

func Hosts() []string

Hosts returns the hosts a Fetcher reaches, for the HTTP client allowlist.

func ParseBlacklist

func ParseBlacklist(r io.Reader) (domain.Snapshot, error)

ParseBlacklist reads the published CSV file into a snapshot, one row per site or address, with the categories separated by "|" and the date as AAAA-MM-JJ, as in the AMF blacklist snapshot. Free-text names and the Dénomination column are left out. A file that departs from the recorded format is rejected with ErrFormat rather than half read.

Types

type Fetcher

type Fetcher struct {
	// contains filtered or unexported fields
}

Fetcher downloads and parses the blacklist. It implements app.SourceFetcher.

func NewBlacklist

func NewBlacklist(client Getter, fileURL string) *Fetcher

NewBlacklist returns the Fetcher of the blacklist, which downloads the file at fileURL, BlacklistURL in production, through client.

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(ctx context.Context) (domain.Snapshot, error)

Fetch downloads the file and parses it.

func (*Fetcher) Spec

func (f *Fetcher) Spec() domain.SnapshotSpec

Spec declares the snapshot columns and the least number of rows.

type Getter

type Getter interface {
	Get(ctx context.Context, rawURL string) ([]byte, error)
}

Getter fetches a URL; *httpclient.Client is one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL