catalog

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 8 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 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.

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) 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