Documentation
¶
Overview ¶
Package updatertest serves fake GitHub releases of xibodev/compa, shaped like the ones the release workflow publishes, for tests of the updater and of the endpoints built on it.
Index ¶
- Constants
- func Archive(t testing.TB, goos string, files map[string]string) []byte
- func ArchiveName(tag, goos, goarch string) string
- func Programs(goos, launcher, kernel string) map[string]string
- func SHA256(b []byte) string
- func Server(t testing.TB, releases ...Release) *httptest.Server
- type Asset
- type Release
Constants ¶
View Source
const NoDigest = "none"
NoDigest as an Asset's Digest makes the fake API report no digest for it.
Variables ¶
This section is empty.
Functions ¶
func Archive ¶
Archive packs files the way the release workflow does: a zip for Windows, a tar.gz otherwise, every file at the root.
func ArchiveName ¶
ArchiveName is the asset name a release uses for goos/goarch.
Types ¶
type Asset ¶
type Asset struct {
Name string
Body []byte
// Digest is what the API reports as the asset's digest: empty reports the
// real SHA-256 of Body, NoDigest reports none, anything else is reported
// verbatim.
Digest string
}
Asset is one file attached to a fake release.
Click to show internal directories.
Click to hide internal directories.