Documentation
¶
Overview ¶
Package channel holds what the Homebrew and Scoop channel tools share (Story 4.4): release version rules, archive names and download URLs, checksums.txt parsing and the Scoop manifest renderer. Hashes always come from the signed checksums.txt.
Problems are returned as plain message strings ("" means none), not errors, so the tools never print error text (AD-3).
Index ¶
- Constants
- Variables
- func Archive(version, goos, goarch string) string
- func CheckVersion(v string) string
- func ParseChecksums(data []byte) (map[string]string, string)
- func RenderScoop(tmplText, version string, sums map[string]string) ([]byte, string)
- func URL(version, archive string) string
- type ScoopData
- type Target
Constants ¶
const ( Description = "Find the AI keys your coding agents have spread and see which are live" Homepage = "https://github.com/aiagentpro/tokenhound" License = "Apache-2.0" )
Metadata both channels must carry; .goreleaser.yaml (homebrew_casks) and dist/scoop/tokenhound.json.tmpl hold the same values.
const Project = "tokenhound"
Project is the GoReleaser project name and archive prefix.
const ReleaseBase = "https://github.com/aiagentpro/tokenhound/releases/download"
ReleaseBase is the GitHub Releases download prefix; the tag is "v" + version. It matches the homebrew_casks url template in .goreleaser.yaml.
Variables ¶
var ScoopKeys = []string{"architecture", "bin", "description", "homepage", "license", "version"}
ScoopKeys are the only top-level keys a Scoop manifest may hold.
var ScoopTargets = map[string]string{"64bit": "amd64", "arm64": "arm64"}
ScoopTargets maps the Scoop architecture keys to Go architectures.
Functions ¶
func CheckVersion ¶
CheckVersion returns a problem unless v is a release version X.Y.Z (optionally with a pre-release or build suffix) without a leading "v".
func ParseChecksums ¶
ParseChecksums reads a GoReleaser checksums.txt ("<sha256> <name>" per line).
func RenderScoop ¶
RenderScoop renders the Scoop manifest template for version from the checksums. It fails naming the archive when a windows archive is missing from checksums, and when the result is not a JSON object with exactly the allowed keys.