Documentation
¶
Overview ¶
Package arcep holds the connector of the national numbering plan the Autorité de régulation des communications électroniques, des postes et de la distribution de la presse publishes under the Licence Ouverte (docs/sources.md): the ranges of phone numbers it has assigned (MAJNUM), joined with the name and SIREN of the operator each range is assigned to (identifiants_CE). The files are Windows-1252 ("ANSI") and replaced whole after each update.
Each snapshot row is one assigned range. Plan indexes them into the domain.NumberingPlan phone numbers are looked up in. An assignment says which operator holds a number's range, nothing about who uses the number.
Index ¶
- Constants
- Variables
- func Hosts() []string
- func NumberingInfo() domain.SourceInfo
- func ParseNumbering(r io.Reader, operators map[string]Operator) (domain.Snapshot, error)
- func ParseOperators(r io.Reader) (map[string]Operator, error)
- func Plan(snap domain.Snapshot) (*domain.NumberingPlan, error)
- type Fetcher
- type Getter
- type Operator
Constants ¶
const ( // ColumnPrefix is the range's prefix ("EZABPQM"). ColumnPrefix = "prefix" // ColumnFirst and ColumnLast are the first and last numbers of the // range, in national form, of the same number of digits. ColumnFirst = "first" ColumnLast = "last" // ColumnOperator is the code of the operator holding the range. ColumnOperator = "operator" // ColumnOperatorName and ColumnOperatorSIREN are the operator's name // and SIREN, "" when the operators file does not give them. ColumnOperatorName = "operator_name" ColumnOperatorSIREN = "operator_siren" // ColumnTerritory is where the range is used. ColumnTerritory = "territory" // ColumnAssignedOn is the assignment date, AAAA-MM-JJ. ColumnAssignedOn = "assigned_on" )
Columns of a numbering snapshot row.
const NumberingSource = signal.NumberingSource
NumberingSource is the name of the numbering plan, as shown to users.
const NumberingURL = "https://extranet.arcep.fr/uploads/MAJNUM.csv"
NumberingURL is the file of the assigned numbering ranges (MAJNUM).
const OperatorsURL = "https://extranet.arcep.fr/uploads/identifiants_CE.csv"
OperatorsURL is the file of the operators ARCEP identifies, with the code ("mnémonique") the numbering file names them by.
Variables ¶
var ErrFormat = errors.New("unexpected ARCEP file format")
ErrFormat means a file is not laid out as docs/sources.md records it.
Functions ¶
func Hosts ¶
func Hosts() []string
Hosts returns the hosts a Fetcher reaches, for the HTTP client allowlist.
func NumberingInfo ¶ added in v0.37.0
func NumberingInfo() domain.SourceInfo
NumberingInfo describes the ARCEP numbering plan for GET /v1/sources: the Licence Ouverte 1.0 (fr-lo) of its data.gouv.fr dataset, checked on 02/11/2026.
func ParseNumbering ¶
ParseNumbering reads the published numbering file into a snapshot, one row per assigned range, with the name and SIREN of its holder from operators. A holder missing from operators, which ARCEP updates on another schedule, is kept with its code only. A file that departs from the recorded format, or whose ranges overlap, is rejected with ErrFormat rather than half read.
func ParseOperators ¶
ParseOperators reads the published operators file into a map from code to operator. Only the name and the SIREN are kept: the address is not needed. 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 the numbering and operators files and joins them into a numbering snapshot. It implements app.SourceFetcher.
func NewNumbering ¶
NewNumbering returns the Fetcher of the numbering plan, which downloads the files at numberingURL and operatorsURL, NumberingURL and OperatorsURL in production, through client.
func (*Fetcher) Spec ¶
func (f *Fetcher) Spec() domain.SnapshotSpec
Spec declares the snapshot columns and the least number of rows.