Documentation
¶
Overview ¶
Package webpkg keeps the machines' page the hub hands out (/dl/web.json, /dl/web.tar.gz) in step with the newest page a release published: the generic package web/<version> of the project's package registry, which only the pipeline of a protected tag may write (tools/ci/publish-web.sh).
Nothing is taken on trust from the registry's listing. A page is taken only when every file of its package was written by a pipeline of the tag v<version>, at the tag's commit, and the archive matches both the registry's SHA-256 and the SHA256SUMS the same pipeline wrote; the archive is downloaded next to the served one and put in place with a rename. Without HUB_WEB_PACKAGE_URL nothing runs and /dl/web.json answers 404: the machines keep the page compiled into their runtime.
Index ¶
Constants ¶
const ( // PackageName is the generic package of the page. PackageName = "web" // Archive is the page: a tar.gz of web/dist. Archive = "web.tar.gz" // Sums is the SHA256SUMS file the release writes next to the archive. Sums = "SHA256SUMS" // Pointer is the file in the hub's folder that names the page it serves. Pointer = "web.json" // Every is the time between two looks at the registry. Every = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Page ¶
type Page struct {
Version string `json:"version"`
SHA256 string `json:"sha256"`
Size int64 `json:"size"`
// File is the archive's name in the folder (web-<version>.tar.gz).
File string `json:"file"`
// Pipeline is the tag's pipeline that wrote the package.
Pipeline int64 `json:"pipeline"`
}
Page is web.json: the page the hub serves now.
type Source ¶
Source is the project's API in the registry (https://host/api/v4/projects/<id>) and a token that may read it.