Documentation
¶
Overview ¶
Package seed implements loading and validating of seed data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAssertions = errors.New("no seed assertions") ErrNoMeta = errors.New("no seed metadata") )
Functions ¶
func MockTrusted ¶
func ValidateFromYaml ¶
ValidateFromYaml validates the given seed.yaml file and surrounding seed.
Types ¶
type Seed ¶
type Seed interface { // LoadAssertions loads all assertions from the seed with // cross-checks. A read-only view on an assertions database // can be passed in together with a commitTo function which // will be used to commit the assertions to the underlying // database. If db is nil an internal temporary database will // be setup instead. ErrNoAssertions will be returned if there // is no assertions directory in the seed, this is legitimate // only on classic. LoadAssertions(db asserts.RODatabase, commitTo func(*asserts.Batch) error) error // Model returns the seed provided model assertion. It is an // error to call Model before LoadAssertions. Model() (*asserts.Model, error) // LoadMeta loads the seed and seed's snaps metadata. It can // return ErrNoMeta if there is no metadata nor snaps in the // seed, this is legitimate only on classic. It is an error to // call LoadMeta before LoadAssertions. LoadMeta(tm timings.Measurer) error // UsesSnapdSnap returns whether the system as defined by the // seed will use the snapd snap, after LoadMeta. UsesSnapdSnap() bool // EssentialSnaps returns the essential snaps as defined by // the seed, after LoadMeta. EssentialSnaps() []*Snap // ModeSnaps returns the snaps that should be available // in the given mode as defined by the seed, after LoadMeta. ModeSnaps(mode string) ([]*Snap, error) }
Seed supports loading assertions and seed snaps' metadata.
type Snap ¶
type Snap struct { Path string SideInfo *snap.SideInfo Essential bool Required bool // options Channel string DevMode bool Classic bool }
Snap holds the details of a snap in a seed.
type Snap16 ¶
type Snap16 struct { Name string `yaml:"name"` // cross-reference/audit SnapID string `yaml:"snap-id,omitempty"` // bits that are orthongonal/not in assertions Channel string `yaml:"channel,omitempty"` DevMode bool `yaml:"devmode,omitempty"` Classic bool `yaml:"classic,omitempty"` Private bool `yaml:"private,omitempty"` Contact string `yaml:"contact,omitempty"` // no assertions are available in the seed for this snap Unasserted bool `yaml:"unasserted,omitempty"` File string `yaml:"file"` }
Snap points to a snap in the seed to install, together with assertions (or alone if unasserted is true) it will be used to drive the installation and ultimately set SideInfo/SnapState for it. TODO: make this internal
Click to show internal directories.
Click to hide internal directories.