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 + var ErrBadModes = errors.New("snap is unusable due to bad permissions") + var ErrMissingPaths = errors.New("snap is unusable due to missing files") + var ErrUnknownRestartCondition = errors.New("invalid restart condition") + var RestartMap = map[string]RestartCondition + var SanitizePlugsSlots = func(snapInfo *Info) + var SupportedSystemUsernames = map[string]systemUsername + func AllUsers(opts *dirs.SnapDirOptions) ([]*user.User, error) + func AppSecurityTag(snapName, appName string) string + func BadInterfacesSummary(snapInfo *Info) string + func BaseDataDir(name string) string + func BaseDir(name string) string + func CommonDataDir(name string) string + func CommonDataSaveDir(name string) string + func DataDir(name string, revision Revision) string + func DataHomeGlob(opts *dirs.SnapDirOptions) string + func DefaultContentProviders(plugs []*PlugInfo) (providerSnapsToContentTag map[string][]string) + func GuessAppsForBroken(info *Info) map[string]*AppInfo + func HookSecurityTag(snapName, hookName string) string + func HooksDir(name string, revision Revision) string + func InstallDate(name string) time.Time + func InstanceName(snapName, instanceKey string) string + func InstanceSnap(instanceName string) string + func IsHookSupported(hookName string) bool + func IsSnapd(snapID string) bool + func JoinSnapApp(snap, app string) string + func MockAppendSupportedHookTypes(hookTypes []*HookType) (restore func()) + func MockSanitizePlugsSlots(f func(snapInfo *Info)) (restore func()) + func MockSupportedHookTypes(hookTypes []*HookType) (restore func()) + func MountDir(name string, revision Revision) string + func MountFile(name string, revision Revision) string + func NeededDefaultProviders(info *Info) (providerSnapsToContentTag map[string][]string) + func NoneSecurityTag(snapName, uniqueName string) string + func ScopedSecurityTag(snapName, scopeName, suffix string) string + func SecurityTag(snapName string) string + func SnapDir(home string, opts *dirs.SnapDirOptions) string + func SplitInstanceName(instanceName string) (snapName, instanceKey string) + func SplitSnapApp(snapApp string) (snap, app string) + func UserCommonDataDir(home string, name string, opts *dirs.SnapDirOptions) string + func UserDataDir(home string, name string, revision Revision, opts *dirs.SnapDirOptions) string + func UserExposedHomeDir(home string, snapName string) string + func UserSnapDir(home string, name string, opts *dirs.SnapDirOptions) string + func UserXdgRuntimeDir(euid sys.UserID, name string) string + func ValidAppName(n string) bool + func Validate(info *Info) error + func ValidateAlias(alias string) error + func ValidateApp(app *AppInfo) error + func ValidateBase(info *Info) error + func ValidateBasesAndProviders(snapInfos []*Info) []error + func ValidateCommonIDs(info *Info) error + func ValidateContainer(c Container, s *Info, logf func(format string, v ...interface{})) error + func ValidateDesktopPrefix(prefix string) bool + func ValidateHook(hook *HookInfo) error + func ValidateInstanceName(instanceName string) error + func ValidateInterfaceName(name string) error + func ValidateLayout(layout *Layout, constraints []LayoutConstraint) error + func ValidateLayoutAll(info *Info) error + func ValidateLicense(license string) error + func ValidateLinks(links map[string][]string) error + func ValidateName(name string) error + func ValidatePathVariables(path string) error + func ValidatePlugName(name string) error + func ValidateSlotName(name string) error + func ValidateSystemUsernames(info *Info) error + func ValidateVersion(version string) error + type AlreadyInstalledError struct + Snap string + func (e AlreadyInstalledError) Error() string + type AppInfo struct + ActivatesOn []*SlotInfo + After []string + Autostart string + Before []string + BusName string + Command string + CommandChain []string + CommonID string + Completer string + Daemon string + DaemonScope DaemonScope + Environment strutil.OrderedMap + InstallMode string + LegacyAliases []string + Name string + Plugs map[string]*PlugInfo + PostStopCommand string + RefreshMode string + ReloadCommand string + RestartCond RestartCondition + RestartDelay timeout.Timeout + Slots map[string]*SlotInfo + Snap *Info + Sockets map[string]*SocketInfo + StartTimeout timeout.Timeout + StopCommand string + StopMode StopModeType + StopTimeout timeout.Timeout + Timer *TimerInfo + WatchdogTimeout timeout.Timeout + func SortServices(apps []*AppInfo) (sorted []*AppInfo, err error) + func (app *AppInfo) CompleterPath() string + func (app *AppInfo) DesktopFile() string + func (app *AppInfo) EnvChain() []osutil.ExpandableEnv + func (app *AppInfo) IsService() bool + func (app *AppInfo) LauncherCommand() string + func (app *AppInfo) LauncherPostStopCommand() string + func (app *AppInfo) LauncherReloadCommand() string + func (app *AppInfo) LauncherStopCommand() string + func (app *AppInfo) LegacyCompleterPath() string + func (app *AppInfo) SecurityTag() string + func (app *AppInfo) ServiceFile() string + func (app *AppInfo) ServiceName() string + func (app *AppInfo) String() string + func (app *AppInfo) WrapperPath() string + type AppInfoBySnapApp []*AppInfo + func (a AppInfoBySnapApp) Len() int + func (a AppInfoBySnapApp) Less(i, j int) bool + func (a AppInfoBySnapApp) Swap(i, j int) + type AttributeNotFoundError struct + Err error + func (e AttributeNotFoundError) Error() string + func (e AttributeNotFoundError) Is(target error) bool + type BrokenSnapError interface + Broken func() string + type ByType []*Info + func (r ByType) Len() int + func (r ByType) Less(i, j int) bool + func (r ByType) Swap(i, j int) + type ChannelSnapInfo struct + Channel string + Confinement ConfinementType + Epoch Epoch + ReleasedAt time.Time + Revision Revision + Size int64 + Version string + type ConfinementType string + const ClassicConfinement + const DevModeConfinement + const StrictConfinement + func (confinementType *ConfinementType) UnmarshalJSON(data []byte) error + func (confinementType *ConfinementType) UnmarshalYAML(unmarshal func(interface{}) error) error + type Container interface + Install func(targetPath, mountDir string, opts *InstallOptions) (bool, error) + ListDir func(path string) ([]string, error) + RandomAccessFile func(relative string) (interface{ ... }, error) + ReadFile func(relative string) ([]byte, error) + Size func() (int64, error) + Unpack func(src, dst string) error + Walk func(relative string, walkFn filepath.WalkFunc) error + type DaemonScope string + const SystemDaemon + const UserDaemon + func (daemonScope *DaemonScope) UnmarshalJSON(data []byte) error + func (daemonScope *DaemonScope) UnmarshalYAML(unmarshal func(interface{}) error) error + type DeltaInfo struct + DownloadURL string + Format string + FromRevision int + Sha3_384 string + Size int64 + ToRevision int + type Device interface + Base func() string + Classic func() bool + Gadget func() string + HasModeenv func() bool + IsClassicBoot func() bool + IsCoreBoot func() bool + Kernel func() string + Model func() *asserts.Model + RunMode func() bool + type DownloadInfo struct + Deltas []DeltaInfo + DownloadURL string + Sha3_384 string + Size int64 + type Epoch struct + Read []uint32 + Write []uint32 + func E(s string) Epoch + func (Epoch) MarshalYAML() (interface{}, error) + func (e *Epoch) CanRead(other Epoch) bool + func (e *Epoch) Equal(other *Epoch) bool + func (e *Epoch) IsZero() bool + func (e *Epoch) UnmarshalJSON(bs []byte) error + func (e *Epoch) UnmarshalYAML(unmarshal func(interface{}) error) error + func (e *Epoch) Validate() error + func (e Epoch) MarshalJSON() ([]byte, error) + func (e Epoch) String() string + type EpochError struct + Message string + func (e EpochError) Error() string + type HookInfo struct + CommandChain []string + Environment strutil.OrderedMap + Explicit bool + Name string + Plugs map[string]*PlugInfo + Slots map[string]*SlotInfo + Snap *Info + func (hook *HookInfo) EnvChain() []osutil.ExpandableEnv + func (hook *HookInfo) SecurityTag() string + type HookType struct + func NewHookType(pattern *regexp.Regexp) *HookType + func (hookType HookType) Match(hookName string) bool + type HotplugKey string + func (h HotplugKey) ShortString() string + type Info struct + Apps map[string]*AppInfo + Architectures []string + Assumes []string + BadInterfaces map[string]string + Base string + Broken string + Channels map[string]*ChannelSnapInfo + CommonIDs []string + Confinement ConfinementType + Environment strutil.OrderedMap + Epoch Epoch + Hooks map[string]*HookInfo + InstanceKey string + Layout map[string]*Layout + LegacyAliases map[string]*AppInfo + LegacyWebsite string + License string + LicenseAgreement string + LicenseVersion string + Media MediaInfos + MustBuy bool + OriginalDescription string + OriginalLinks map[string][]string + OriginalSummary string + OriginalTitle string + Plugs map[string]*PlugInfo + Prices map[string]float64 + Publisher StoreAccount + Slots map[string]*SlotInfo + SnapProvenance string + SnapType Type + StoreURL string + SuggestedName string + SystemUsernames map[string]*SystemUsernameInfo + Tracks []string + Version string + func InfoFromSnapYaml(yamlData []byte) (*Info, error) + func ReadCurrentInfo(snapName string) (*Info, error) + func ReadInfo(name string, si *SideInfo) (*Info, error) + func ReadInfoFromSnapFile(snapf Container, si *SideInfo) (*Info, error) + func (s *Info) CommonDataDir() string + func (s *Info) CommonDataHomeDir(opts *dirs.SnapDirOptions) string + func (s *Info) CommonDataSaveDir() string + func (s *Info) Contact() string + func (s *Info) DataDir() string + func (s *Info) DataHomeDir(opts *dirs.SnapDirOptions) string + func (s *Info) Description() string + func (s *Info) DesktopPrefix() string + func (s *Info) ExpandSnapVariables(path string) string + func (s *Info) Filename() string + func (s *Info) HooksDir() string + func (s *Info) ID() string + func (s *Info) InstallDate() time.Time + func (s *Info) InstanceName() string + func (s *Info) IsActive() bool + func (s *Info) Links() map[string][]string + func (s *Info) MountDir() string + func (s *Info) MountFile() string + func (s *Info) NeedsClassic() bool + func (s *Info) NeedsDevMode() bool + func (s *Info) Provenance() string + func (s *Info) Services() []*AppInfo + func (s *Info) SnapName() string + func (s *Info) SnapRevision() Revision + func (s *Info) Summary() string + func (s *Info) Title() string + func (s *Info) Type() Type + func (s *Info) UserCommonDataDir(home string, opts *dirs.SnapDirOptions) string + func (s *Info) UserDataDir(home string, opts *dirs.SnapDirOptions) string + func (s *Info) UserExposedHomeDir(home string) string + func (s *Info) UserXdgRuntimeDir(euid sys.UserID) string + func (s *Info) Website() string + func (s *Info) XdgRuntimeDirs() string + type InstallOptions struct + MustNotCrossDevices bool + type Layout struct + Bind string + BindFile string + Group string + Mode os.FileMode + Path string + Snap *Info + Symlink string + Type string + User string + func (l *Layout) String() string + type LayoutConstraint interface + IsOffLimits func(path string) bool + type MediaInfo struct + Height int64 + Type string + URL string + Width int64 + type MediaInfos []MediaInfo + func (mis MediaInfos) IconURL() string + type NotFoundError struct + Path string + Revision Revision + Snap string + func (e NotFoundError) Broken() string + func (e NotFoundError) Error() string + type NotInstalledError struct + Rev Revision + Snap string + func (e NotInstalledError) Error() string + type NotSnapError struct + Path string + func (e NotSnapError) Error() string + type PlaceInfo interface + CommonDataDir func() string + CommonDataHomeDir func(opts *dirs.SnapDirOptions) string + CommonDataSaveDir func() string + DataDir func() string + DataHomeDir func(opts *dirs.SnapDirOptions) string + Filename func() string + HooksDir func() string + InstanceName func() string + MountDir func() string + MountFile func() string + SnapName func() string + SnapRevision func() Revision + UserCommonDataDir func(home string, opts *dirs.SnapDirOptions) string + UserDataDir func(home string, opts *dirs.SnapDirOptions) string + UserExposedHomeDir func(home string) string + UserXdgRuntimeDir func(userID sys.UserID) string + XdgRuntimeDirs func() string + func MinimalPlaceInfo(name string, revision Revision) PlaceInfo + func ParsePlaceInfoFromSnapFileName(sn string) (PlaceInfo, error) + type PlugInfo struct + Apps map[string]*AppInfo + Attrs map[string]interface{} + Hooks map[string]*HookInfo + Interface string + Label string + Name string + Snap *Info + func (plug *PlugInfo) Attr(key string, val interface{}) error + func (plug *PlugInfo) Lookup(key string) (interface{}, bool) + func (plug *PlugInfo) SecurityTags() []string + func (plug *PlugInfo) String() string + type RestartCondition string + const RestartAlways + const RestartNever + const RestartOnAbnormal + const RestartOnAbort + const RestartOnFailure + const RestartOnSuccess + const RestartOnWatchdog + func (rc *RestartCondition) UnmarshalYAML(unmarshal func(interface{}) error) error + func (rc RestartCondition) String() string + type Revision struct + N int + func ParseRevision(s string) (Revision, error) + func R(r interface{}) Revision + func (r *Revision) UnmarshalJSON(data []byte) error + func (r *Revision) UnmarshalYAML(unmarshal func(interface{}) error) error + func (r Revision) Local() bool + func (r Revision) MarshalJSON() ([]byte, error) + func (r Revision) MarshalYAML() (interface{}, error) + func (r Revision) Store() bool + func (r Revision) String() string + func (r Revision) Unset() bool + type ScreenshotInfo struct + Height int64 + Note string + URL string + Width int64 + type ServiceStopReason string + const StopReasonDisable + const StopReasonOther + const StopReasonRefresh + const StopReasonRemove + type SideInfo struct + Channel string + EditedDescription string + EditedLinks map[string][]string + EditedSummary string + EditedTitle string + LegacyEditedContact string + Paid bool + Private bool + RealName string + Revision Revision + SnapID string + type SlotInfo struct + Apps map[string]*AppInfo + Attrs map[string]interface{} + Hooks map[string]*HookInfo + HotplugKey HotplugKey + Interface string + Label string + Name string + Snap *Info + func (slot *SlotInfo) Attr(key string, val interface{}) error + func (slot *SlotInfo) Lookup(key string) (interface{}, bool) + func (slot *SlotInfo) SecurityTags() []string + func (slot *SlotInfo) String() string + type SnapshotOptions struct + ExcludePaths []string + func ReadSnapshotYaml(si *Info) (*SnapshotOptions, error) + func ReadSnapshotYamlFromSnapFile(snapf Container) (*SnapshotOptions, error) + type SocketInfo struct + App *AppInfo + ListenStream string + Name string + SocketMode os.FileMode + func (socket *SocketInfo) File() string + type StopModeType string + func (st StopModeType) KillAll() bool + func (st StopModeType) KillSignal() string + func (st StopModeType) Validate() error + type StoreAccount struct + DisplayName string + ID string + Username string + Validation string + type SystemUsernameInfo struct + Attrs map[string]interface{} + Name string + Scope string + type TimerInfo struct + App *AppInfo + Timer string + func (timer *TimerInfo) File() string + type Type string + const TypeApp + const TypeBase + const TypeGadget + const TypeKernel + const TypeOS + const TypeSnapd + func (m *Type) UnmarshalJSON(data []byte) error + func (m *Type) UnmarshalYAML(unmarshal func(interface{}) error) error + func (m Type) SortsBefore(other Type) bool