catalog

package
v0.59.1 Latest Latest
Warning

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

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

Documentation

Overview

Package catalog lists the sources Arnakoff syncs, how often, and the hosts they reach: the one list the sync and API processes are built from.

Index

Constants

This section is empty.

Variables

View Source
var ErrOffline = errors.New("this process downloads nothing")

ErrOffline is returned by Offline.Get.

Functions

func Blacklists added in v0.25.0

func Blacklists(opts Options, snaps listing.Snapshots) []app.Blacklist

Blacklists returns the blacklists opts turns on, each read from the snapshot of its source in snaps, for app.Registries.

func Hosts

func Hosts(opts Options) []string

Hosts returns, once each, the hosts the sources opts turns on reach, for the allowlist of the HTTP client New takes.

func Lists added in v0.35.0

func Lists(opts Options, snaps listing.Snapshots, platforms domain.Platforms) app.Registries

Lists returns the lists a check reads, each from the snapshot of its source in snaps: the blacklists opts turns on, the white lists and the numbering plan. The registries are left to the caller.

func Numbering added in v0.28.0

func Numbering(snaps listing.Snapshots) []app.Numbering

Numbering returns the ARCEP numbering plan, read from its snapshot in snaps, for app.Registries.

func Whitelists added in v0.26.0

func Whitelists(snaps listing.Snapshots, platforms domain.Platforms) []app.Whitelist

Whitelists returns the white lists, each read from the snapshot of its source in snaps, for app.Registries. A page entry on one of platforms covers nothing (listing.WhitelistOf).

Types

type Catalog

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

Catalog is the list of the sources turned on, in a stable order.

func New

func New(client Getter, opts Options) *Catalog

New returns the catalog of the sources opts turns on, downloading through client.

func (*Catalog) Fetchers

func (c *Catalog) Fetchers() []app.SourceFetcher

Fetchers returns the fetcher of each source, for app.NewSync.

func (*Catalog) Infos added in v0.37.0

func (c *Catalog) Infos() []domain.SourceInfo

Infos describes each source, for app.NewSourceList.

func (*Catalog) Plans

func (c *Catalog) Plans() []app.Plan

Plans returns how often each source is synced, for app.NewScheduler.

type Getter

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

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

type Offline

type Offline struct{}

Offline is the Getter of a process that only restores snapshots, such as the API: it refuses every download.

func (Offline) Get

func (Offline) Get(context.Context, string) ([]byte, error)

Get returns ErrOffline.

type Options

type Options struct {
	// ACPR turns the ACPR blacklist on, once its reuse licence is obtained.
	ACPR bool
}

Options are the sources the configuration turns on beyond the default ones.

Jump to

Keyboard shortcuts

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