Documentation
¶
Overview ¶
Package dbcatalogbuild builds, validates and signs the database version catalog (databases.v1.json) from upstream registries and endoflife.date. The publisher script and the control plane's direct mode share it.
Index ¶
- Constants
- func GenerateKey() (priv, pub string, err error)
- func Sign(privB64 string, data []byte) (string, error)
- func ValidChannel(c string) bool
- func ValidateAgainst(next File, prev *File) error
- func Verify(pubB64, sigB64 string, data []byte) error
- type Builder
- type Cycle
- type CycleSource
- type EOLClient
- type Engine
- type File
- type Line
- type RateLimitedError
- type RegistryTags
- type Source
- type Spec
- type TagLister
- type Version
Constants ¶
const ( ChannelStable = "stable" ChannelLTS = "lts" ChannelRC = "rc" ChannelBeta = "beta" ChannelEOL = "eol" )
Release channels of a version.
const DockerHubBase = "https://registry-1.docker.io"
DockerHubBase is the OCI endpoint that serves Docker Hub repositories.
const EOLBase = "https://endoflife.date/api"
EOLBase is the endoflife.date API root.
const SchemaVersion = 1
SchemaVersion is the only catalog schema this build reads or writes.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
GenerateKey returns a base64 private key and public key pair.
func ValidChannel ¶
ValidChannel reports whether c is a known release channel.
func ValidateAgainst ¶
ValidateAgainst enforces the publish gates: schema, no empty engine, and no engine shrinking by more than a third versus prev (nil prev skips it).
Types ¶
type Builder ¶
type Builder struct {
Tags TagLister
Cycles CycleSource
Accept func(engine, version string) bool
Now func() time.Time
}
Builder assembles catalog engines. Accept, when set, drops versions the control plane would refuse (ValidateEngineVersion).
type Cycle ¶
type Cycle struct {
Cycle string `json:"cycle"`
ReleaseDate string `json:"releaseDate"`
EOL json.RawMessage `json:"eol"`
Latest string `json:"latest"`
LatestReleaseDate string `json:"latestReleaseDate"`
LTS bool `json:"lts"`
}
Cycle is one endoflife.date release cycle.
type CycleSource ¶
CycleSource returns an engine's release cycles from endoflife.date.
type Engine ¶
type Engine struct {
Source Source `json:"source"`
Versions []Version `json:"versions"`
Lines []Line `json:"lines"`
}
Engine is one engine's published versions and release lines.
type File ¶
type File struct {
Schema int `json:"schema"`
GeneratedAt string `json:"generated_at"`
Engines map[string]Engine `json:"engines"`
}
File is the published catalog document.
type Line ¶
type Line struct {
Line string `json:"line"`
EOL string `json:"eol,omitempty"`
LTS bool `json:"lts,omitempty"`
}
Line is a release line with its end-of-life date.
type RateLimitedError ¶
RateLimitedError is an upstream 429 with its Retry-After.
func (*RateLimitedError) Error ¶
func (e *RateLimitedError) Error() string
type RegistryTags ¶
type RegistryTags struct {
Client *registrycatalog.Client
BaseURL string
}
RegistryTags lists tags through the OCI distribution API.
type Source ¶
type Source struct {
EOLURL string `json:"eol_url,omitempty"`
TagsURL string `json:"tags_url,omitempty"`
ReleaseNotesURL string `json:"release_notes_url,omitempty"`
}
Source links to where an engine's data came from.
type Spec ¶
type Spec struct {
ID string
Repo string
EOLSlug string
ReleaseNotesURL string
StableRe *regexp.Regexp
PreRe *regexp.Regexp
Lines []string
}
Spec describes where one engine's data comes from. Group 1 of StableRe and PreRe is the release line a tag belongs to.
func DefaultSpecs ¶
func DefaultSpecs() []Spec
DefaultSpecs lists the engines the publisher covers. Engines whose images are not on Docker Hub (dragonfly, keydb) are left to the embedded catalog. Extending Lines is the one edit a new supported major needs.