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 AllowInteractionHeader + const ClassicConfinement + const DevModeConfinement + const SnapshotExportMediaType + const StatusActive + const StatusAvailable + const StatusInstalled + const StatusPriced + const StatusRemoved + const StorageEncryptionSupportAvailable + const StorageEncryptionSupportDefective + const StorageEncryptionSupportDisabled + const StorageEncryptionSupportUnavailable + const StrictConfinement + const TypeApp + const TypeGadget + const TypeKernel + const TypeOS + var ErrDangerousNotApplicable = fmt.Errorf("dangerous option only meaningful when installing from a local file") + var ErrNoData = fmt.Errorf("data entry not found") + var ErrNoNames = errors.New(`"names" must not be empty`) + var ErrNoSnapsInstalled = errors.New("no snaps installed") + var ErrSnapshotSetNotFound = errors.New("no snapshot set with the given ID") + var ErrSnapshotSnapsNotFound = errors.New("no snapshot for the requested snaps found in the set with the given ID") + func InternalSnapctlCmdNeedsStdin(name string) bool + func IsAssertionNotFoundError(err error) bool + func IsInterfacesUnchangedError(err error) bool + func IsRetryable(err error) bool + func IsTwoFactorError(err error) bool + func MockDoTimings(retry, timeout time.Duration) (restore func()) + type AliasStatus struct + Auto string + Command string + Manual string + Status string + type AppActivator struct + Active bool + Enabled bool + Name string + Type string + type AppInfo struct + Activators []AppActivator + Active bool + CommonID string + Daemon string + DaemonScope snap.DaemonScope + DesktopFile string + Enabled bool + Name string + Snap string + func (a *AppInfo) IsService() bool + type AppOptions struct + Service bool + type AuthorizationError struct + Err error + func (e AuthorizationError) Error() string + func (e AuthorizationError) Is(target error) bool + type BuyOptions struct + Currency string + Price float64 + SnapID string + type BuyResult struct + State string + type Change struct + Err string + ID string + Kind string + Ready bool + ReadyTime time.Time + SpawnTime time.Time + Status string + Summary string + Tasks []*Task + func (c *Change) Get(key string, value interface{}) error + type ChangeSelector uint8 + const ChangesAll + const ChangesInProgress + const ChangesReady + func (c ChangeSelector) String() string + type ChangesOptions struct + Selector ChangeSelector + SnapName string + type Client struct + func New(config *Config) *Client + func (c *Client) Icon(pkgID string) (*Icon, error) + func (c *Client) MigrateSnapHome(snaps []string) (changeID string, err error) + func (client *Client) Abort(id string) (*Change, error) + func (client *Client) Ack(b []byte) error + func (client *Client) Alias(snapName, app, alias string) (changeID string, err error) + func (client *Client) Aliases() (allStatuses map[string]map[string]AliasStatus, err error) + func (client *Client) ApplyValidationSet(accountID, name string, opts *ValidateApplyOptions) (res *ValidationSetResult, err error) + func (client *Client) Apps(names []string, opts AppOptions) ([]*AppInfo, error) + func (client *Client) AssertionTypes() ([]string, error) + func (client *Client) Buy(opts *BuyOptions) (*BuyResult, error) + func (client *Client) Change(id string) (*Change, error) + func (client *Client) Changes(opts *ChangesOptions) ([]*Change, error) + func (client *Client) CheckSnapshots(setID uint64, snaps []string, users []string) (changeID string, err error) + func (client *Client) Conf(snapName string, keys []string) (configuration map[string]interface{}, err error) + func (client *Client) Connect(plugSnapName, plugName, slotSnapName, slotName string) (changeID string, err error) + func (client *Client) Connections(opts *ConnectionOptions) (Connections, error) + func (client *Client) CreateCohorts(snaps []string) (map[string]string, error) + func (client *Client) CreateUser(options *CreateUserOptions) (*CreateUserResult, error) + func (client *Client) CreateUsers(options []*CreateUserOptions) ([]*CreateUserResult, error) + func (client *Client) CurrentModelAssertion() (*asserts.Model, error) + func (client *Client) CurrentSerialAssertion() (*asserts.Serial, error) + func (client *Client) Debug(action string, params interface{}, result interface{}) error + func (client *Client) DebugGet(aspect string, result interface{}, params map[string]string) error + func (client *Client) Disable(name string, options *SnapOptions) (changeID string, err error) + func (client *Client) DisableAllAliases(snapName string) (changeID string, err error) + func (client *Client) Disconnect(plugSnapName, plugName, slotSnapName, slotName string, opts *DisconnectOptions) (changeID string, err error) + func (client *Client) DoSystemAction(systemLabel string, action *SystemAction) error + func (client *Client) Download(name string, options *DownloadOptions) (dlInfo *DownloadInfo, r io.ReadCloser, err error) + func (client *Client) Enable(name string, options *SnapOptions) (changeID string, err error) + func (client *Client) EnsureQuota(groupName string, parent string, snaps []string, constraints *QuotaValues) (changeID string, err error) + func (client *Client) Find(opts *FindOptions) ([]*Snap, *ResultInfo, error) + func (client *Client) FindOne(name string) (*Snap, *ResultInfo, error) + func (client *Client) ForgetSnapshots(setID uint64, snaps []string) (changeID string, err error) + func (client *Client) ForgetValidationSet(accountID, name string, sequence int) error + func (client *Client) GetQuotaGroup(groupName string) (*QuotaGroupResult, error) + func (client *Client) Hijack(f func(*http.Request) (*http.Response, error)) + func (client *Client) HoldRefreshes(name string, options *SnapOptions) (changeID string, err error) + func (client *Client) HoldRefreshesMany(names []string, options *SnapOptions) (changeID string, err error) + func (client *Client) Install(name string, options *SnapOptions) (changeID string, err error) + func (client *Client) InstallMany(names []string, options *SnapOptions) (changeID string, err error) + func (client *Client) InstallPath(path, name string, options *SnapOptions) (changeID string, err error) + func (client *Client) InstallPathMany(paths []string, options *SnapOptions) (changeID string, err error) + func (client *Client) InstallSystem(systemLabel string, opts *InstallSystemOptions) (changeID string, err error) + func (client *Client) Interfaces(opts *InterfaceOptions) ([]*Interface, error) + func (client *Client) InternalConsoleConfStart() ([]string, []string, error) + func (client *Client) Known(assertTypeName string, headers map[string]string, opts *KnownOptions) ([]asserts.Assertion, error) + func (client *Client) List(names []string, opts *ListOptions) ([]*Snap, error) + func (client *Client) ListSystems() ([]System, error) + func (client *Client) ListValidationsSets() ([]*ValidationSetResult, error) + func (client *Client) LoggedInUser() *User + func (client *Client) Login(email, password, otp string) (*User, error) + func (client *Client) Logout() error + func (client *Client) Logs(names []string, opts LogOptions) (<-chan Log, error) + func (client *Client) Maintenance() error + func (client *Client) Okay(t time.Time) error + func (client *Client) Prefer(snapName string) (changeID string, err error) + func (client *Client) Quotas() ([]*QuotaGroupResult, error) + func (client *Client) ReadyToBuy() error + func (client *Client) RebootToSystem(systemLabel, mode string) error + func (client *Client) Refresh(name string, options *SnapOptions) (changeID string, err error) + func (client *Client) RefreshMany(names []string, options *SnapOptions) (changeID string, err error) + func (client *Client) Remodel(b []byte) (changeID string, err error) + func (client *Client) Remove(name string, options *SnapOptions) (changeID string, err error) + func (client *Client) RemoveManualAlias(alias string) (changeID string, err error) + func (client *Client) RemoveMany(names []string, options *SnapOptions) (changeID string, err error) + func (client *Client) RemoveQuotaGroup(groupName string) (changeID string, err error) + func (client *Client) RemoveUser(options *RemoveUserOptions) (removed []*User, err error) + func (client *Client) Restart(names []string, opts RestartOptions) (changeID string, err error) + func (client *Client) RestoreSnapshots(setID uint64, snaps []string, users []string) (changeID string, err error) + func (client *Client) Revert(name string, options *SnapOptions) (changeID string, err error) + func (client *Client) RunSnapctl(options *SnapCtlOptions, stdin io.Reader) (stdout, stderr []byte, err error) + func (client *Client) Sections() ([]string, error) + func (client *Client) ServerVersion() (*ServerVersion, error) + func (client *Client) SetConf(snapName string, patch map[string]interface{}) (changeID string, err error) + func (client *Client) Snap(name string) (*Snap, *ResultInfo, error) + func (client *Client) SnapshotExport(setID uint64) (stream io.ReadCloser, contentLength int64, err error) + func (client *Client) SnapshotImport(exportStream io.Reader, size int64) (SnapshotImportSet, error) + func (client *Client) SnapshotMany(names []string, users []string) (setID uint64, changeID string, err error) + func (client *Client) SnapshotSets(setID uint64, snapNames []string) ([]SnapshotSet, error) + func (client *Client) Start(names []string, opts StartOptions) (changeID string, err error) + func (client *Client) Stop(names []string, opts StopOptions) (changeID string, err error) + func (client *Client) StoreAccount(accountID string) (*snap.StoreAccount, error) + func (client *Client) Switch(name string, options *SnapOptions) (changeID string, err error) + func (client *Client) SysInfo() (*SysInfo, error) + func (client *Client) SystemDetails(systemLabel string) (*SystemDetails, error) + func (client *Client) SystemRecoveryKeys(result interface{}) error + func (client *Client) Try(path string, options *SnapOptions) (changeID string, err error) + func (client *Client) Unalias(aliasOrSnap string) (changeID string, err error) + func (client *Client) UnholdRefreshes(name string, options *SnapOptions) (changeID string, err error) + func (client *Client) UnholdRefreshesMany(names []string, options *SnapOptions) (changeID string, err error) + func (client *Client) Users() ([]*User, error) + func (client *Client) ValidationSet(accountID, name string, sequence int) (*ValidationSetResult, error) + func (client *Client) Warnings(opts WarningsOptions) ([]*Warning, error) + func (client *Client) WarningsSummary() (count int, timestamp time.Time) + func (client *Client) WhoAmI() (string, error) + type CohortAction struct + Action string + Snaps []string + type Config struct + BaseURL string + DisableAuth bool + DisableKeepAlive bool + Interactive bool + Socket string + UserAgent string + type Connection struct + Gadget bool + Interface string + Manual bool + Plug PlugRef + PlugAttrs map[string]interface{} + Slot SlotRef + SlotAttrs map[string]interface{} + type ConnectionError struct + Err error + func (e ConnectionError) Error() string + func (e ConnectionError) Unwrap() error + type ConnectionOptions struct + All bool + Interface string + Snap string + type Connections struct + Established []Connection + Plugs []Plug + Slots []Slot + Undesired []Connection + type CreateUserOptions struct + Automatic bool + Email string + ForceManaged bool + Known bool + Sudoer bool + type CreateUserResult struct + SSHKeys []string + Username string + type DisconnectOptions struct + Forget bool + type DownloadInfo struct + ResumeToken string + Sha3_384 string + Size int64 + SuggestedFileName string + type DownloadOptions struct + HeaderPeek bool + Resume int64 + ResumeToken string + type Error struct + Kind ErrorKind + Message string + StatusCode int + Value interface{} + func (e *Error) Error() string + type ErrorKind string + const ErrorKindAppNotFound + const ErrorKindAssertionNotFound + const ErrorKindAuthCancelled + const ErrorKindBadQuery + const ErrorKindConfigNoSuchOption + const ErrorKindDNSFailure + const ErrorKindDaemonRestart + const ErrorKindInsufficientDiskSpace + const ErrorKindInterfacesUnchanged + const ErrorKindInvalidAuthData + const ErrorKindLoginRequired + const ErrorKindNetworkTimeout + const ErrorKindNoPaymentMethods + const ErrorKindNotSnap + const ErrorKindPasswordPolicy + const ErrorKindPaymentDeclined + const ErrorKindQuotaChangeConflict + const ErrorKindSnapAlreadyInstalled + const ErrorKindSnapArchitectureNotAvailable + const ErrorKindSnapChangeConflict + const ErrorKindSnapChannelNotAvailable + const ErrorKindSnapLocal + const ErrorKindSnapNeedsClassic + const ErrorKindSnapNeedsClassicSystem + const ErrorKindSnapNeedsDevMode + const ErrorKindSnapNoUpdateAvailable + const ErrorKindSnapNotClassic + const ErrorKindSnapNotFound + const ErrorKindSnapNotInstalled + const ErrorKindSnapRevisionNotAvailable + const ErrorKindSystemRestart + const ErrorKindTermsNotAccepted + const ErrorKindTwoFactorFailed + const ErrorKindTwoFactorRequired + const ErrorKindUnsuccessful + const ErrorKindValidationSetNotFound + type FindOptions struct + CommonID string + Prefix bool + Private bool + Query string + Refresh bool + Scope string + Section string + type Icon struct + Content []byte + Filename string + type InstallStep string + const InstallStepFinish + const InstallStepSetupStorageEncryption + type InstallSystemOptions struct + OnVolumes map[string]*gadget.Volume + Step InstallStep + type Interface struct + DocURL string + Name string + Plugs []Plug + Slots []Slot + Summary string + type InterfaceAction struct + Action string + Forget bool + Plugs []Plug + Slots []Slot + type InterfaceOptions struct + Connected bool + Doc bool + Names []string + Plugs bool + Slots bool + type InternalClientError struct + Err error + func (e InternalClientError) Error() string + func (e InternalClientError) Is(target error) bool + type InternalConsoleConfStartResponse struct + ActiveAutoRefreshChanges []string + ActiveAutoRefreshSnaps []string + type KnownOptions struct + Remote bool + type ListOptions struct + All bool + type Log struct + Message string + PID string + SID string + Timestamp time.Time + func (l Log) String() string + func (l Log) StringInUTC() string + type LogOptions struct + Follow bool + N int + type OSRelease struct + ID string + VersionID string + type Plug struct + Apps []string + Attrs map[string]interface{} + Connections []SlotRef + Interface string + Label string + Name string + Snap string + type PlugRef struct + Name string + Snap string + type QuotaCPUSetValues struct + CPUs []int + type QuotaCPUValues struct + Count int + Percentage int + type QuotaGroupResult struct + Constraints *QuotaValues + Current *QuotaValues + GroupName string + Parent string + Snaps []string + Subgroups []string + type QuotaJournalRate struct + RateCount int + RatePeriod time.Duration + type QuotaJournalValues struct + Size quantity.Size + type QuotaValues struct + CPU *QuotaCPUValues + CPUSet *QuotaCPUSetValues + Journal *QuotaJournalValues + Memory quantity.Size + Threads int + type RefreshInfo struct + Hold string + Last string + Next string + Schedule string + Timer string + type RemoveUserOptions struct + Username string + type RequestError struct + func (e RequestError) Error() string + type RestartOptions struct + Reload bool + type ResultInfo struct + SuggestedCurrency string + type ServerVersion struct + Architecture string + KernelVersion string + OSID string + OSVersionID string + OnClassic bool + Series string + Version string + Virtualization string + type Slot struct + Apps []string + Attrs map[string]interface{} + Connections []PlugRef + Interface string + Label string + Name string + Snap string + type SlotRef struct + Name string + Snap string + type Snap struct + Apps []AppInfo + Base string + Broken string + Channel string + Channels map[string]*snap.ChannelSnapInfo + CohortKey string + CommonIDs []string + Confinement string + Contact string + Description string + DevMode bool + Developer string + DownloadSize int64 + Health *SnapHealth + ID string + Icon string + IgnoreValidation bool + InstallDate time.Time + InstalledSize int64 + JailMode bool + License string + Links map[string][]string + Media snap.MediaInfos + MountedFrom string + Name string + Prices map[string]float64 + Private bool + Publisher *snap.StoreAccount + Revision snap.Revision + Screenshots []snap.ScreenshotInfo + Status string + StoreURL string + Summary string + Title string + TrackingChannel string + Tracks []string + TryMode bool + Type string + Version string + Website string + func (s *Snap) MarshalJSON() ([]byte, error) + type SnapCtlOptions struct + Args []string + ContextID string + type SnapCtlPostData struct + Stdin []byte + type SnapHealth struct + Code string + Message string + Revision snap.Revision + Status string + Timestamp time.Time + type SnapOptions struct + Amend bool + Channel string + Classic bool + CohortKey string + Dangerous bool + DevMode bool + HoldLevel string + IgnoreRunning bool + IgnoreValidation bool + JailMode bool + LeaveCohort bool + Purge bool + QuotaGroupName string + Revision string + Time string + Transaction TransactionType + Unaliased bool + Users []string + ValidationSets []string + type Snapshot struct + Auto bool + Broken string + Conf map[string]interface{} + Epoch snap.Epoch + Revision snap.Revision + SHA3_384 map[string]string + SetID uint64 + Size int64 + Snap string + SnapID string + Summary string + Time time.Time + Version string + func (sh *Snapshot) ContentHash() ([]byte, error) + func (sh *Snapshot) IsValid() bool + type SnapshotImportSet struct + ID uint64 + Snaps []string + type SnapshotSet struct + ID uint64 + Snapshots []*Snapshot + func (ss SnapshotSet) ContentHash() ([]byte, error) + func (ss SnapshotSet) Size() int64 + func (ss SnapshotSet) Time() time.Time + type StartOptions struct + Enable bool + type StopOptions struct + Disable bool + type StorageEncryption struct + StorageSafety string + Support StorageEncryptionSupport + Type string + UnavailableReason string + type StorageEncryptionSupport string + type SysInfo struct + Architecture string + BuildID string + Confinement string + KernelVersion string + Managed bool + OSRelease OSRelease + OnClassic bool + Refresh RefreshInfo + SandboxFeatures map[string][]string + Series string + Version string + Virtualization string + type System struct + Actions []SystemAction + Brand snap.StoreAccount + Current bool + Label string + Model SystemModelData + type SystemAction struct + Mode string + Title string + type SystemDetails struct + Actions []SystemAction + Brand snap.StoreAccount + Current bool + Label string + Model map[string]interface{} + StorageEncryption *StorageEncryption + Volumes map[string]*gadget.Volume + type SystemModelData struct + BrandID string + DisplayName string + Model string + type SystemRecoveryKeysResponse struct + RecoveryKey string + ReinstallKey string + type Task struct + ID string + Kind string + Log []string + Progress TaskProgress + ReadyTime time.Time + SpawnTime time.Time + Status string + Summary string + type TaskProgress struct + Done int + Label string + Total int + type TransactionType string + const TransactionAllSnaps + const TransactionPerSnap + type User struct + Discharges []string + Email string + ID int + Macaroon string + Username string + type ValidateApplyOptions struct + Mode string + Sequence int + type ValidationSetResult struct + AccountID string + Mode string + Name string + PinnedAt int + Sequence int + Valid bool + type Warning struct + ExpireAfter time.Duration + FirstAdded time.Time + LastAdded time.Time + LastShown time.Time + Message string + RepeatAfter time.Duration + type WarningsOptions struct + All bool