format

package
v0.0.0-...-d2be893 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package format reads each package format's files and writes its index: apt's, pacman's, apk's and rpm's, signed, in Go alone.

Index

Constants

View Source
const (
	Apt  = "apt"
	Arch = "arch"
	APK  = "apk"
	RPM  = "rpm"
)

The formats there are.

Variables

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

ErrFormat is a package or a name a format refuses.

View Source
var Names = []string{Apt, Arch, APK, RPM}

Names are the formats there are.

Functions

func OpenPGP

func OpenPGP(name string) bool

OpenPGP is whether a format signs with an OpenPGP key, else an RSA one.

Types

type Format

type Format interface {
	Name() string
	// Accept refuses a file name the format doesn't take.
	Accept(file string) error
	// Parse reads a package's own metadata; the hashes are the caller's.
	Parse(file string, r io.ReaderAt, size int64) (*meta.Package, error)
	// Paths are where a package is served; one in several architectures
	// is served in each.
	Paths(p *meta.Package) []string
	// Index is every index file by its served path, signed.
	Index(pkgs []*meta.Package, at time.Time) (map[string][]byte, error)
	// Keys are the public key files served, by path.
	Keys() (map[string][]byte, error)
	// Immutable is whether an index path's content never changes.
	Immutable(path string) bool
}

Format is one package format: how its files are read, where they are served, and the index that lists them.

func New

func New(name string, o Options, s Signer) (Format, error)

New is the format named, with its defaults filled in.

type Options

type Options struct {
	// Suite and Component are apt's; Archs every format's architectures,
	// those a package of any architecture is listed under.
	Suite     string
	Component string
	Archs     []string
	// Repo is pacman's database name, KeyName apk's key file name.
	Repo    string
	KeyName string
	Origin  string
}

Options are a store's own words for its format.

type Signer

type Signer struct {
	PGP *sign.OpenPGP
	RSA *sign.RSA
}

Signer holds the key a format signs with.

Jump to

Keyboard shortcuts

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