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 ByName = func(name string) (iface Interface, err error) + var ErrSystemKeyMissing = errors.New("system-key missing on disk") + var ErrSystemKeyVersion = errors.New("system-key versions not comparable") + func BeforeConnectPlug(iface Interface, plug *ConnectedPlug) error + func BeforePreparePlug(iface Interface, plugInfo *snap.PlugInfo) error + func BeforePrepareSlot(iface Interface, slotInfo *snap.SlotInfo) error + func CurrentSystemKey() (interface{}, error) + func MockSystemKey(s string) func() + func PermanentPlugServiceSnippets(iface Interface, plug *snap.PlugInfo) (snips []string, err error) + func RecordedSystemKey() (interface{}, error) + func SecurityTagGlob(snapName string) string + func SetupMany(repo *Repository, backend SecurityBackend, snaps []*snap.Info, ...) []error + func SystemKeyMismatch() (bool, error) + func SystemKeysMatch(systemKey1, systemKey2 interface{}) (bool, error) + func UnmarshalJSONSystemKey(r io.Reader) (interface{}, error) + func ValidateDBusBusName(busName string) error + func WriteSystemKey() error + type Attrer interface + Attr func(path string, value interface{}) error + Lookup func(path string) (value interface{}, ok bool) + type ConfinementOptions struct + Classic bool + DevMode bool + ExtraLayouts []snap.Layout + JailMode bool + type ConnPlugSanitizer interface + BeforeConnectPlug func(plug *ConnectedPlug) error + type ConnRef struct + PlugRef PlugRef + SlotRef SlotRef + func NewConnRef(plug *snap.PlugInfo, slot *snap.SlotInfo) *ConnRef + func ParseConnRef(id string) (*ConnRef, error) + func (conn *ConnRef) ID() string + func (conn *ConnRef) SortsBefore(other *ConnRef) bool + type ConnectedPlug struct + func NewConnectedPlug(plug *snap.PlugInfo, staticAttrs, dynamicAttrs map[string]interface{}) *ConnectedPlug + func (plug *ConnectedPlug) Apps() map[string]*snap.AppInfo + func (plug *ConnectedPlug) Attr(key string, val interface{}) error + func (plug *ConnectedPlug) DynamicAttrs() map[string]interface{} + func (plug *ConnectedPlug) Hooks() map[string]*snap.HookInfo + func (plug *ConnectedPlug) Interface() string + func (plug *ConnectedPlug) Lookup(path string) (interface{}, bool) + func (plug *ConnectedPlug) Name() string + func (plug *ConnectedPlug) Ref() *PlugRef + func (plug *ConnectedPlug) SecurityTags() []string + func (plug *ConnectedPlug) SetAttr(key string, value interface{}) error + func (plug *ConnectedPlug) Snap() *snap.Info + func (plug *ConnectedPlug) StaticAttr(key string, val interface{}) error + func (plug *ConnectedPlug) StaticAttrs() map[string]interface{} + type ConnectedSlot struct + func NewConnectedSlot(slot *snap.SlotInfo, staticAttrs, dynamicAttrs map[string]interface{}) *ConnectedSlot + func (slot *ConnectedSlot) Apps() map[string]*snap.AppInfo + func (slot *ConnectedSlot) Attr(key string, val interface{}) error + func (slot *ConnectedSlot) DynamicAttrs() map[string]interface{} + func (slot *ConnectedSlot) Hooks() map[string]*snap.HookInfo + func (slot *ConnectedSlot) Interface() string + func (slot *ConnectedSlot) Lookup(path string) (interface{}, bool) + func (slot *ConnectedSlot) Name() string + func (slot *ConnectedSlot) Ref() *SlotRef + func (slot *ConnectedSlot) SecurityTags() []string + func (slot *ConnectedSlot) SetAttr(key string, value interface{}) error + func (slot *ConnectedSlot) Snap() *snap.Info + func (slot *ConnectedSlot) StaticAttr(key string, val interface{}) error + func (slot *ConnectedSlot) StaticAttrs() map[string]interface{} + type Connection struct + Plug *ConnectedPlug + Slot *ConnectedSlot + func (conn *Connection) Interface() string + type Info struct + DocURL string + Name string + Plugs []*snap.PlugInfo + Slots []*snap.SlotInfo + Summary string + type InfoOptions struct + Connected bool + Doc bool + Names []string + Plugs bool + Slots bool + type Interface interface + AutoConnect func(plug *snap.PlugInfo, slot *snap.SlotInfo) bool + Name func() string + type Interfaces struct + Connections []*ConnRef + Plugs []*snap.PlugInfo + Slots []*snap.SlotInfo + type NoPlugOrSlotError struct + func (e *NoPlugOrSlotError) Error() string + type NotConnectedError struct + func (e *NotConnectedError) Error() string + type PlugRef struct + Name string + Snap string + func (ref PlugRef) SortsBefore(other PlugRef) bool + func (ref PlugRef) String() string + type PlugSanitizer interface + BeforePreparePlug func(plug *snap.PlugInfo) error + type PolicyFunc func(*ConnectedPlug, *ConnectedSlot) (bool, error) + type Repository struct + func NewRepository() *Repository + func (r *Repository) AddBackend(backend SecurityBackend) error + func (r *Repository) AddInterface(i Interface) error + func (r *Repository) AddPlug(plug *snap.PlugInfo) error + func (r *Repository) AddSlot(slot *snap.SlotInfo) error + func (r *Repository) AddSnap(snapInfo *snap.Info) error + func (r *Repository) AllHotplugInterfaces() map[string]Interface + func (r *Repository) AllInterfaces() []Interface + func (r *Repository) AllPlugs(interfaceName string) []*snap.PlugInfo + func (r *Repository) AllSlots(interfaceName string) []*snap.SlotInfo + func (r *Repository) AutoConnectCandidatePlugs(slotSnapName, slotName string, ...) []*snap.PlugInfo + func (r *Repository) AutoConnectCandidateSlots(plugSnapName, plugName string, ...) ([]*snap.SlotInfo, []SideArity) + func (r *Repository) Backends() []SecurityBackend + func (r *Repository) Connect(ref *ConnRef, ...) (*Connection, error) + func (r *Repository) Connected(snapName, plugOrSlotName string) ([]*ConnRef, error) + func (r *Repository) Connection(connRef *ConnRef) (*Connection, error) + func (r *Repository) Connections(snapName string) ([]*ConnRef, error) + func (r *Repository) ConnectionsForHotplugKey(ifaceName string, hotplugKey snap.HotplugKey) ([]*ConnRef, error) + func (r *Repository) Disconnect(plugSnapName, plugName, slotSnapName, slotName string) error + func (r *Repository) DisconnectAll(conns []*ConnRef) + func (r *Repository) DisconnectSnap(snapName string) ([]string, error) + func (r *Repository) Info(opts *InfoOptions) []*Info + func (r *Repository) Interface(interfaceName string) Interface + func (r *Repository) Interfaces() *Interfaces + func (r *Repository) Plug(snapName, plugName string) *snap.PlugInfo + func (r *Repository) Plugs(snapName string) []*snap.PlugInfo + func (r *Repository) RemovePlug(snapName, plugName string) error + func (r *Repository) RemoveSlot(snapName, slotName string) error + func (r *Repository) RemoveSnap(snapName string) error + func (r *Repository) ResolveConnect(plugSnapName, plugName, slotSnapName, slotName string) (*ConnRef, error) + func (r *Repository) Slot(snapName, slotName string) *snap.SlotInfo + func (r *Repository) SlotForHotplugKey(ifaceName string, hotplugKey snap.HotplugKey) (*snap.SlotInfo, error) + func (r *Repository) Slots(snapName string) []*snap.SlotInfo + func (r *Repository) SnapSpecification(securitySystem SecuritySystem, snapName string) (Specification, error) + func (r *Repository) UpdateHotplugSlotAttrs(ifaceName string, hotplugKey snap.HotplugKey, ...) (*snap.SlotInfo, error) + type SecurityBackend interface + Initialize func(opts *SecurityBackendOptions) error + Name func() SecuritySystem + NewSpecification func() Specification + Remove func(snapName string) error + SandboxFeatures func() []string + Setup func(snapInfo *snap.Info, opts ConfinementOptions, repo *Repository, ...) error + type SecurityBackendDiscardingLate interface + RemoveLate func(snapName string, rev snap.Revision, typ snap.Type) error + type SecurityBackendOptions struct + CoreSnapInfo *snap.Info + Preseed bool + SnapdSnapInfo *snap.Info + type SecurityBackendSetupMany interface + SetupMany func(snaps []*snap.Info, confinement func(snapName string) ConfinementOptions, ...) []error + type SecuritySystem string + const SecurityAppArmor + const SecurityDBus + const SecurityKMod + const SecurityMount + const SecurityPolkit + const SecuritySecComp + const SecuritySystemd + const SecurityUDev + type SideArity interface + SlotsPerPlugAny func() bool + type SlotRef struct + Name string + Snap string + func (ref SlotRef) SortsBefore(other SlotRef) bool + func (ref SlotRef) String() string + type SlotSanitizer interface + BeforePrepareSlot func(slot *snap.SlotInfo) error + type Specification interface + AddConnectedPlug func(iface Interface, plug *ConnectedPlug, slot *ConnectedSlot) error + AddConnectedSlot func(iface Interface, plug *ConnectedPlug, slot *ConnectedSlot) error + AddPermanentPlug func(iface Interface, plug *snap.PlugInfo) error + AddPermanentSlot func(iface Interface, slot *snap.SlotInfo) error + type StaticInfo struct + AffectsPlugOnRefresh bool + BaseDeclarationPlugs string + BaseDeclarationSlots string + DocURL string + ImplicitOnClassic bool + ImplicitOnCore bool + Summary string + func StaticInfoOf(iface Interface) (si StaticInfo)