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 ¶
const ( Apt = "apt" Arch = "arch" APK = "apk" RPM = "rpm" )
The formats there are.
Variables ¶
var ErrFormat = errors.New("format")
ErrFormat is a package or a name a format refuses.
Names are the formats there are.
Functions ¶
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.
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.