Documentation
¶
Overview ¶
Package lock models pacto.lock: the committed, deterministic record of the resolved dependency + reference closure.
Index ¶
Constants ¶
const CurrentLockVersion = 1
CurrentLockVersion is the schema version this build writes.
const FileName = "pacto.lock"
FileName is the lockfile name, alongside pacto.yaml.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConflictError ¶
type ConflictError struct{ Service string }
ConflictError: the closure requires a service at two incompatible versions.
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
type DriftError ¶
type DriftError struct{ Name, Locked, Current string }
DriftError: a locked OCI digest no longer matches the current resolution.
func (*DriftError) Error ¶
func (e *DriftError) Error() string
type Entry ¶
type Entry struct {
Name string `yaml:"name" json:"name"`
Source string `yaml:"source" json:"source"` // "oci" or "local"
Ref string `yaml:"ref,omitempty" json:"ref,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Constraint string `yaml:"constraint,omitempty" json:"constraint,omitempty"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
Digest string `yaml:"digest,omitempty" json:"digest,omitempty"`
ContentHash string `yaml:"contentHash,omitempty" json:"contentHash,omitempty"`
DependsOn []string `yaml:"dependsOn,omitempty" json:"dependsOn,omitempty"`
}
Entry is one resolved dependency in the closure.
type LocalDriftError ¶
type LocalDriftError struct{ Name, Locked, Current string }
LocalDriftError: a local dependency's content hash changed.
func (*LocalDriftError) Error ¶
func (e *LocalDriftError) Error() string
type Lock ¶
type Lock struct {
LockVersion int `yaml:"lockVersion" json:"lockVersion"`
Pacto PactoInfo `yaml:"pacto" json:"pacto"`
Root RootInfo `yaml:"root" json:"root"`
Dependencies []Entry `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
References []Reference `yaml:"references,omitempty" json:"references,omitempty"`
}
Lock is the root document of pacto.lock.
func (*Lock) Dependency ¶
Dependency returns the entry with the given name.
type MissingError ¶
type MissingError struct{ Path string }
MissingError: a lock was required (e.g. --check) but none exists.
func (*MissingError) Error ¶
func (e *MissingError) Error() string
type PactoInfo ¶
type PactoInfo struct {
Version string `yaml:"version" json:"version"`
}
PactoInfo records the CLI version that produced the lock.
type Reference ¶
type Reference struct {
Kind string `yaml:"kind" json:"kind"` // "config" or "policy"
Name string `yaml:"name" json:"name"`
Source string `yaml:"source" json:"source"`
Ref string `yaml:"ref,omitempty" json:"ref,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
Digest string `yaml:"digest,omitempty" json:"digest,omitempty"`
ContentHash string `yaml:"contentHash,omitempty" json:"contentHash,omitempty"`
}
Reference is one resolved config/policy reference. Config/policy sources carry no compatibility constraint (unlike dependencies), so a reference has no Constraint field.
type RootInfo ¶
type RootInfo struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version" json:"version"`
}
RootInfo identifies the contract the lock belongs to.
type StaleError ¶
type StaleError struct{ Detail string }
StaleError: pacto.yaml and pacto.lock disagree on which deps/refs exist.
func (*StaleError) Error ¶
func (e *StaleError) Error() string
type UnresolvedError ¶
UnresolvedError: a ref could not be resolved while building the lock.
func (*UnresolvedError) Error ¶
func (e *UnresolvedError) Error() string