Documentation
¶
Overview ¶
Package receipt reads and writes the records of the trees sofcat placed for zip items: one JSON file per tree at <dir>/<placement>/<item>.json. The service keeps its receipts under <data dir>/receipts; other callers, such as a per-user helper, pass their own directory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MachineDir ¶
MachineDir is the service's receipt directory inside its data directory.
Types ¶
type Receipt ¶
type Receipt struct {
Item string `json:"item"`
Version string `json:"version"`
Placement string `json:"placement"`
// Path is the tree's directory: <placement root>/<item>, or
// <placement root>/plugins/<item> in a marketplace.
Path string `json:"path"`
// TreeHash is the catalog's hash of the archive's contents.
TreeHash string `json:"tree_hash"`
// PlacedHash is the hash of the tree as sofcat wrote it, rendered files
// included: TreeHash when nothing was rendered. Read fills it from
// TreeHash for a receipt written before it existed.
PlacedHash string `json:"placed_hash"`
// Rendered records each file sofcat rendered inside the tree, in path
// order. Write saves it as [] when there is none, never omits it.
Rendered []Rendered `json:"rendered"`
// Managed is true when a manifest lists the item in managed_installs.
Managed bool `json:"managed"`
InstalledAtUTC time.Time `json:"installed_at_utc"`
}
Receipt records one placed tree.
type Rendered ¶
type Rendered struct {
// File and Template are slash-separated paths relative to the tree.
File string `json:"file"`
Template string `json:"template"`
// Inputs is what the render used: os, scope, user, item (name, version,
// managed) and the facts the template read. It is kept as written, so a
// number compares as written when the next run asks whether the inputs
// changed.
Inputs json.RawMessage `json:"inputs"`
}
Rendered records one file sofcat rendered inside a tree from a template the tree ships.