Documentation ¶
Overview ¶
Interfaces of hitch commands.
The hitch CLI provides all these functions; it's also an interface used purely in-memory by some other systems (like heft) which handle both plan evaluation and release management in the same process.
Index ¶
- func LineagePluckReleaseByName(lin api.Lineage, releaseName api.ReleaseName) (*api.Release, error)
- func LineagePluckReleaseItem(lin api.Lineage, releaseName api.ReleaseName, itemName api.ItemName) (*api.WareID, error)
- func LineagePrependRelease(lin api.Lineage, rel api.Release) (*api.Lineage, error)
- type ErrorCategory
- type LookupError
- type ViewLineageTool
- type ViewWarehousesTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LineagePluckReleaseByName ¶
LineagePluckReleaseByName traverses a linage and returns a release by name. This is a useful function because the serial form of release catalogs stores them in an ordered array.
An error may be returned of category LookupError.
A pointer is returned to express maybe-ness; mutating it has no effect.
func LineagePluckReleaseItem ¶
func LineagePluckReleaseItem(lin api.Lineage, releaseName api.ReleaseName, itemName api.ItemName) (*api.WareID, error)
LineagePluckReleaseItem traverses a lineage and returns a wareID looked up by release and item label.
An error may be returned of category LookupError.
A pointer is returned to express maybe-ness; mutating it has no effect.
func LineagePrependRelease ¶
LineagePrependRelease returns a new modified lineage with the release pushed onto the top of the lineage's list of releases.
Any error will be of category LookupError.
A pointer is returned to express maybe-ness.
Types ¶
type ErrorCategory ¶
type ErrorCategory string
const ( ErrUsage ErrorCategory = ("hitch-usage-error") ErrCorruptState ErrorCategory = ("hitch-corrupt-state") // Indicates saved state is corrupt somehow (does not parse, or fails invariant checks). ErrNameCollision ErrorCategory = ("hitch-name-collision") // Indicates some mutation could not be performed because it tried to add data under some name that's already used. )
type LookupError ¶
type LookupError string
const ( ErrNoSuchLineage LookupError = ("no-such-lineage") ErrNoSuchRelease LookupError = ("no-such-release") ErrNoSuchItem LookupError = ("no-such-item") )
type ViewLineageTool ¶
type ViewWarehousesTool ¶
type ViewWarehousesTool func( context.Context, api.ModuleName, ) (*api.WareSourcing, error)