Documentation ¶
Overview ¶
Package assertstate implements the manager and state aspects responsible for the enforcement of assertions in the system and manages the system-wide assertion database.
Index ¶
- func Add(s *state.State, a asserts.Assertion) error
- func DB(s *state.State) asserts.RODatabase
- func RefreshSnapDeclarations(s *state.State, userID int) error
- func ReplaceDB(state *state.State, db *asserts.Database)
- func ValidateRefreshes(s *state.State, snapInfos []*snap.Info, userID int) (validated []*snap.Info, err error)
- type AssertManager
- type Batch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DB ¶
func DB(s *state.State) asserts.RODatabase
DB returns a read-only view of system assertion database.
func RefreshSnapDeclarations ¶
RefreshSnapDeclarations refetches all the current snap declarations and their prerequisites.
func ValidateRefreshes ¶
func ValidateRefreshes(s *state.State, snapInfos []*snap.Info, userID int) (validated []*snap.Info, err error)
ValidateRefreshes validates the refresh candidate revisions represented by the snapInfos, looking for the needed refresh control validation assertions, it returns a validated subset in validated and a summary error if not all candidates validated.
Types ¶
type AssertManager ¶
type AssertManager struct {
// contains filtered or unexported fields
}
AssertManager is responsible for the enforcement of assertions in system states. It manipulates the observed system state to ensure nothing in it violates existing assertions, or misses required ones.
func Manager ¶
func Manager(s *state.State) (*AssertManager, error)
Manager returns a new assertion manager.
func (*AssertManager) Ensure ¶
func (m *AssertManager) Ensure() error
Ensure implements StateManager.Ensure.
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
Batch allows to accumulate a set of assertions possibly out of prerequisite order and then add them in one go to the system assertion database.
func NewBatch ¶
func NewBatch() *Batch
NewBatch creates a new Batch to accumulate assertions to add in one go to the system assertion database.