Versions in this module Expand all Collapse all v0 v0.1.0 Nov 12, 2022 v0.0.1 Nov 10, 2022 Changes in this version + const AfterMaybeRebootWaitEdge + const BeforeHooksEdge + const BeforeMaybeRebootEdge + const BeginEdge + const HooksEdge + const IgnoreHookError + const LastBeforeLocalModificationsEdge + const MaybeRebootEdge + const MaybeRebootWaitEdge + const TrackHookError + const UseConfigDefaults + var AddCurrentTrackingToValidationSetsStack func(st *state.State) error + var AddSnapToQuotaGroup = func(st *state.State, snapName string, quotaGroup string) (*state.Task, error) + var AutoAliases func(st *state.State, info *snap.Info) (map[string]string, error) + var AutoRefreshAssertions func(st *state.State, userID int) error + var AutomaticSnapshot func(st *state.State, instanceName string) (ts *state.TaskSet, err error) + var AutomaticSnapshotExpiration func(st *state.State) (time.Duration, error) + var CanAutoRefresh func(st *state.State) (bool, error) + var CanManageRefreshes func(st *state.State) bool + var CheckHealthHook = func(st *state.State, snapName string, rev snap.Revision) *state.Task + var Configure = func(st *state.State, snapName string, patch map[string]interface{}, flags int) *state.TaskSet + var DeviceCtx func(st *state.State, task *state.Task, providedDeviceCtx DeviceContext) (DeviceContext, error) + var EnforceValidationSets func(*state.State, map[string]*asserts.ValidationSet, map[string]int, ...) error + var EnforcedValidationSets func(st *state.State, extraVss ...*asserts.ValidationSet) (*snapasserts.ValidationSets, error) + var EnsureSnapAbsentFromQuotaGroup = func(st *state.State, snap string) error + var ErrKernelGadgetUpdateTaskMissing = errors.New(...) + var ErrMissingExpectedResult = fmt.Errorf("unexpectedly empty response from the server (try again later)") + var ErrNoCurrent = errors.New("snap has no current revision") + var ErrNothingToDo = errors.New("nothing to do") + var EstimateSnapshotSize func(st *state.State, instanceName string, users []string) (uint64, error) + var FinalTasks = []string + var GetSnapDirOpts = func(st *state.State, name string) (*dirs.SnapDirOptions, error) + var IsOnMeteredConnection func() (bool, error) + var PolicyFor func(snap.Type, *asserts.Model) Policy = policyForUnset + var RemodelingChange func(st *state.State) *state.Change + var RestoreValidationSetsTracking func(st *state.State) error + var SecurityProfilesRemoveLate = func(snapName string, rev snap.Revision, typ snap.Type) error + var SetupGateAutoRefreshHook = func(st *state.State, snapName string) *state.Task + var SetupInstallHook = func(st *state.State, snapName string) *state.Task + var SetupPostRefreshHook = func(st *state.State, snapName string) *state.Task + var SetupPreRefreshHook = func(st *state.State, snapName string) *state.Task + var SetupRemoveHook = func(st *state.State, snapName string) *state.Task + var SnapServiceOptions = func(st *state.State, instanceName string, grps map[string]*quota.Group) (opts *wrappers.SnapServiceOptions, err error) + var TestingLeaveOutKernelUpdateGadgetAssets bool = false + var ValidateRefreshes func(st *state.State, refreshes []*snap.Info, ignoreValidation map[string]bool, ...) (validated []*snap.Info, err error) + func ActiveInfos(st *state.State) ([]*snap.Info, error) + func AddCheckSnapCallback(check CheckSnapCallback) + func AddGadgetAssetsTasks(st *state.State, ts *state.TaskSet) (*state.TaskSet, error) + func AddLinkNewBaseOrKernel(st *state.State, ts *state.TaskSet) (*state.TaskSet, error) + func AddLinkSnapParticipant(p LinkSnapParticipant) + func AffectedByRefreshCandidates(st *state.State) (map[string]*AffectedSnapInfo, error) + func AffectingSnapsForAffectedByRefreshCandidates(st *state.State, affectedSnap string) ([]string, error) + func Alias(st *state.State, instanceName, app, alias string) (*state.TaskSet, error) + func All(st *state.State) (map[string]*SnapState, error) + func AutoRefresh(ctx context.Context, st *state.State) ([]string, []*state.TaskSet, error) + func AutoRefreshForGatingSnap(st *state.State, gatingSnap string) error + func BootBaseInfo(st *state.State, deviceCtx DeviceContext) (*snap.Info, error) + func CheckChangeConflict(st *state.State, instanceName string, snapst *SnapState) error + func CheckChangeConflictMany(st *state.State, instanceNames []string, ignoreChangeID string) error + func CheckChangeConflictRunExclusively(st *state.State, newChangeKind string) error + func ConfigDefaults(st *state.State, deviceCtx DeviceContext, snapName string) (map[string]interface{}, error) + func ConfigureSnap(st *state.State, snapName string, confFlags int) *state.TaskSet + func CurrentInfo(st *state.State, name string) (*snap.Info, error) + func Disable(st *state.State, name string) (*state.TaskSet, error) + func DisableAllAliases(st *state.State, instanceName string) (*state.TaskSet, error) + func Enable(st *state.State, name string) (*state.TaskSet, error) + func FinishRestart(task *state.Task, snapsup *SnapSetup) (err error) + func FinishTaskWithRestart(task *state.Task, status state.Status, rt restart.RestartType, ...) error + func GadgetConnections(st *state.State, deviceCtx DeviceContext) ([]gadget.Connection, error) + func GadgetInfo(st *state.State, deviceCtx DeviceContext) (*snap.Info, error) + func Get(st *state.State, name string, snapst *SnapState) error + func HardNothingRunningRefreshCheck(info *snap.Info) error + func HasSnapOfType(st *state.State, snapType snap.Type) (bool, error) + func HeldSnaps(st *state.State, level HoldLevel) (map[string]bool, error) + func HoldRefresh(st *state.State, level HoldLevel, gatingSnap string, ...) (time.Duration, error) + func HoldRefreshesBySystem(st *state.State, level HoldLevel, holdTime string, holdSnaps []string) error + func Info(st *state.State, name string, revision snap.Revision) (*snap.Info, error) + func InjectAutoConnect(mainTask *state.Task, snapsup *SnapSetup) + func InjectTasks(mainTask *state.Task, extraTasks *state.TaskSet) + func Install(ctx context.Context, st *state.State, name string, opts *RevisionOptions, ...) (*state.TaskSet, error) + func InstallMany(st *state.State, names []string, revOpts []*RevisionOptions, userID int, ...) ([]string, []*state.TaskSet, error) + func InstallPath(st *state.State, si *snap.SideInfo, path, instanceName, channel string, ...) (*state.TaskSet, *snap.Info, error) + func InstallPathMany(ctx context.Context, st *state.State, sideInfos []*snap.SideInfo, ...) ([]*state.TaskSet, error) + func InstallWithDeviceContext(ctx context.Context, st *state.State, name string, opts *RevisionOptions, ...) (*state.TaskSet, error) + func InstalledSnaps(st *state.State) (snaps []*snapasserts.InstalledSnap, ignoreValidation map[string]bool, ...) + func Installing(st *state.State) bool + func KernelInfo(st *state.State, deviceCtx DeviceContext) (*snap.Info, error) + func LinkNewBaseOrKernel(st *state.State, name string) (*state.TaskSet, error) + func MigrateHome(st *state.State, snaps []string) ([]*state.TaskSet, error) + func MockCheckSnapCallbacks(checks []CheckSnapCallback) (restore func()) + func MockEnforceSingleRebootForBaseKernelGadget(val bool) (restore func()) + func MockLinkSnapParticipants(ps []LinkSnapParticipant) (restore func()) + func MockOsutilCheckFreeSpace(mock func(path string, minSize uint64) error) (restore func()) + func MockRefreshCandidate(snapSetup *SnapSetup, version string) interface + func ModelFromTask(task *state.Task) (*asserts.Model, error) + func NewTaskProgressAdapterLocked(t *state.Task) progress.Meter + func NewTaskProgressAdapterUnlocked(t *state.Task) progress.Meter + func NumSnaps(st *state.State) (int, error) + func Prefer(st *state.State, name string) (*state.TaskSet, error) + func ProceedWithRefresh(st *state.State, gatingSnap string, unholdSnaps []string) error + func RefreshCandidates(st *state.State, user *auth.UserState) ([]*snap.Info, error) + func RegisterAffectedSnapsByAttr(attr string, f AffectedSnapsFunc) + func RegisterAffectedSnapsByKind(kind string, f AffectedSnapsFunc) + func Remove(st *state.State, name string, revision snap.Revision, flags *RemoveFlags) (*state.TaskSet, error) + func RemoveManualAlias(st *state.State, alias string) (ts *state.TaskSet, instanceName string, err error) + func RemoveMany(st *state.State, names []string, flags *RemoveFlags) ([]string, []*state.TaskSet, error) + func ReplaceStore(state *state.State, store StoreService) + func ResolveValidationSetsEnforcementError(ctx context.Context, st *state.State, ...) ([]*state.TaskSet, []string, error) + func Revert(st *state.State, name string, flags Flags, fromChange string) (*state.TaskSet, error) + func RevertToRevision(st *state.State, name string, rev snap.Revision, flags Flags, ...) (*state.TaskSet, error) + func Set(st *state.State, name string, snapst *SnapState) + func SetTaskSnapSetup(t *state.Task, snapsup *SnapSetup) error + func SoftNothingRunningRefreshCheck(info *snap.Info) error + func Switch(st *state.State, name string, opts *RevisionOptions) (*state.TaskSet, error) + func SwitchToNewGadget(st *state.State, name string) (*state.TaskSet, error) + func TransitionCore(st *state.State, oldName, newName string) ([]*state.TaskSet, error) + func TryPath(st *state.State, name, path string, flags Flags) (*state.TaskSet, error) + func Update(st *state.State, name string, opts *RevisionOptions, userID int, flags Flags) (*state.TaskSet, error) + func UpdateBootRevisions(st *state.State) error + func UpdateMany(ctx context.Context, st *state.State, names []string, ...) ([]string, []*state.TaskSet, error) + func UpdateWithDeviceContext(st *state.State, name string, opts *RevisionOptions, userID int, flags Flags, ...) (*state.TaskSet, error) + type AffectedSnapInfo struct + AffectingSnaps map[string]bool + Base bool + Restart bool + type AffectedSnapsFunc func(*state.Task) ([]string, error) + type AliasConflictError struct + Alias string + Conflicts map[string][]string + Reason string + Snap string + func (e *AliasConflictError) Error() string + type AliasTarget struct + Auto string + Manual string + func (at *AliasTarget) Effective(autoDisabled bool) string + type BusySnapError struct + SnapInfo *snap.Info + func (err *BusySnapError) Error() string + func (err *BusySnapError) PendingSnapRefreshInfo() *userclient.PendingSnapRefreshInfo + func (err BusySnapError) Pids() []int + type ChangeConflictError struct + ChangeID string + ChangeKind string + Message string + Snap string + func (e *ChangeConflictError) Error() string + func (e *ChangeConflictError) Is(err error) bool + type CheckSnapCallback func(st *state.State, snap, curSnap *snap.Info, snapf snap.Container, flags Flags, ...) error + type DeviceContext interface + ForRemodeling func() bool + GroundContext func() DeviceContext + Store func() StoreService + SystemMode func() string + func DeviceCtxFromState(st *state.State, providedDeviceCtx DeviceContext) (DeviceContext, error) + func DevicePastSeeding(st *state.State, providedDeviceCtx DeviceContext) (DeviceContext, error) + type Flags struct + Amend bool + ApplySnapDevMode bool + Classic bool + DevMode bool + IgnoreRunning bool + IgnoreValidation bool + IsAutoRefresh bool + JailMode bool + Lane int + NoReRefresh bool + QuotaGroupName string + RemoveSnapPath bool + RequireTypeBase bool + Required bool + Revert bool + RevertStatus RevertStatus + SkipConfigure bool + SkipKernelExtraction bool + Transaction client.TransactionType + TryMode bool + Unaliased bool + func (f Flags) DevModeAllowed() bool + func (f Flags) ForSnapSetup() Flags + type GateAutoRefreshAction int + const GateAutoRefreshHold + const GateAutoRefreshProceed + type HoldDurationError struct + DurationLeft time.Duration + Err error + func (h *HoldDurationError) Error() string + type HoldError struct + SnapsInError map[string]HoldDurationError + func (h *HoldError) Error() string + type HoldLevel int + const HoldAutoRefresh + const HoldGeneral + type InsufficientSpaceError struct + ChangeKind string + Message string + Path string + Snaps []string + func (e *InsufficientSpaceError) Error() string + type LinkSnapParticipant interface + SnapLinkageChanged func(st *state.State, instanceName string) error + type LinkSnapParticipantFunc func(st *state.State, instanceName string) error + func (f LinkSnapParticipantFunc) SnapLinkageChanged(st *state.State, instanceName string) error + type PendingSecurityState struct + SideInfo *snap.SideInfo + type Policy interface + CanRemove func(st *state.State, snapst *SnapState, rev snap.Revision, dev snap.Device) error + type RemoveFlags struct + Purge bool + type RevertStatus int + const DefaultStatus + const NotBlocked + type RevisionOptions struct + Channel string + CohortKey string + LeaveCohort bool + Revision snap.Revision + ValidationSets []snapasserts.ValidationSetKey + type SnapManager struct + func Manager(st *state.State, runner *state.TaskRunner) (*SnapManager, error) + func (m *SnapManager) CanStandby() bool + func (m *SnapManager) EffectiveRefreshHold() (time.Time, error) + func (m *SnapManager) Ensure() error + func (m *SnapManager) EnsureAutoRefreshesAreDelayed(delay time.Duration) ([]*state.Change, error) + func (m *SnapManager) LastRefresh() (time.Time, error) + func (m *SnapManager) NextRefresh() time.Time + func (m *SnapManager) RefreshSchedule() (string, bool, error) + func (m *SnapManager) StartUp() error + func (m *SnapManager) SyncCookies(st *state.State) error + type SnapNeedsClassicError struct + Snap string + func (e *SnapNeedsClassicError) Error() string + type SnapNeedsClassicSystemError struct + Snap string + func (e *SnapNeedsClassicSystemError) Error() string + type SnapNeedsDevModeError struct + Snap string + func (e *SnapNeedsDevModeError) Error() string + type SnapNotClassicError struct + Snap string + func (e *SnapNotClassicError) Error() string + type SnapSetup struct + Base string + Channel string + CohortKey string + DisableExposedHome bool + DownloadInfo *snap.DownloadInfo + EnableExposedHome bool + ExpectedProvenance string + InstanceKey string + MigratedHidden bool + MigratedToExposedHome bool + PlugsOnly bool + Prereq []string + PrereqContentAttrs map[string][]string + RemovedExposedHome bool + SideInfo *snap.SideInfo + SnapPath string + Type snap.Type + UndidHiddenMigration bool + UserID int + func TaskSnapSetup(t *state.Task) (*SnapSetup, error) + func (snapsup *SnapSetup) InstanceName() string + func (snapsup *SnapSetup) MountDir() string + func (snapsup *SnapSetup) MountFile() string + func (snapsup *SnapSetup) Revision() snap.Revision + func (snapsup *SnapSetup) SnapName() string + type SnapState struct + Active bool + Aliases map[string]*AliasTarget + AliasesPending bool + AutoAliasesDisabled bool + CohortKey string + Current snap.Revision + InstanceKey string + LastActiveDisabledServices []string + LastRefreshTime *time.Time + MigratedHidden bool + MigratedToExposedHome bool + PendingSecurity *PendingSecurityState + RefreshInhibitedTime *time.Time + RevertStatus map[int]RevertStatus + Sequence []*snap.SideInfo + ServicesDisabledByHooks []string + ServicesEnabledByHooks []string + SnapType string + TrackingChannel string + UserID int + func (snapst *SnapState) Block() []snap.Revision + func (snapst *SnapState) CurrentInfo() (*snap.Info, error) + func (snapst *SnapState) CurrentSideInfo() *snap.SideInfo + func (snapst *SnapState) InstanceName() string + func (snapst *SnapState) IsInstalled() bool + func (snapst *SnapState) LastIndex(revision snap.Revision) int + func (snapst *SnapState) LocalRevision() snap.Revision + func (snapst *SnapState) SetTrackingChannel(s string) error + func (snapst *SnapState) SetType(typ snap.Type) + func (snapst *SnapState) Type() (snap.Type, error) + type StoreService interface + Assertion func(assertType *asserts.AssertionType, primaryKey []string, user *auth.UserState) (asserts.Assertion, error) + Buy func(options *client.BuyOptions, user *auth.UserState) (*client.BuyResult, error) + ConnectivityCheck func() (map[string]bool, error) + CreateCohorts func(context.Context, []string) (map[string]string, error) + Download func(context.Context, string, string, *snap.DownloadInfo, progress.Meter, ...) error + DownloadAssertions func([]string, *asserts.Batch, *auth.UserState) error + DownloadStream func(context.Context, string, *snap.DownloadInfo, int64, *auth.UserState) (r io.ReadCloser, status int, err error) + EnsureDeviceSession func() error + Find func(ctx context.Context, search *store.Search, user *auth.UserState) ([]*snap.Info, error) + LoginUser func(username, password, otp string) (string, string, error) + ReadyToBuy func(*auth.UserState) error + Sections func(ctx context.Context, user *auth.UserState) ([]string, error) + SeqFormingAssertion func(assertType *asserts.AssertionType, sequenceKey []string, sequence int, ...) (asserts.Assertion, error) + SnapAction func(ctx context.Context, currentSnaps []*store.CurrentSnap, ...) ([]store.SnapActionResult, []store.AssertionResult, error) + SnapExists func(ctx context.Context, spec store.SnapSpec, user *auth.UserState) (naming.SnapRef, *channel.Channel, error) + SnapInfo func(ctx context.Context, spec store.SnapSpec, user *auth.UserState) (*snap.Info, error) + SuggestedCurrency func() string + UserInfo func(email string) (userinfo *store.User, err error) + WriteCatalogs func(ctx context.Context, names io.Writer, adder store.SnapAdder) error + func Store(st *state.State, deviceCtx DeviceContext) StoreService