Documentation
¶
Overview ¶
configfiles is a backend that ensures that configuration files required by interfaces are present in the system. Currently it works only on classic and modifies the classic rootfs.
Index ¶
- type Backend
- func (b *Backend) Initialize(opts *interfaces.SecurityBackendOptions) error
- func (b *Backend) Name() interfaces.SecuritySystem
- func (b *Backend) NewSpecification(*interfaces.SnapAppSet, interfaces.ConfinementOptions) interfaces.Specification
- func (b *Backend) Remove(snapName string) error
- func (b *Backend) SandboxFeatures() []string
- func (b *Backend) Setup(appSet *interfaces.SnapAppSet, opts interfaces.ConfinementOptions, ...) error
- type Specification
- func (spec *Specification) AddConnectedPlug(iface interfaces.Interface, plug *interfaces.ConnectedPlug, ...) error
- func (spec *Specification) AddConnectedSlot(iface interfaces.Interface, plug *interfaces.ConnectedPlug, ...) error
- func (spec *Specification) AddPathContent(path string, state osutil.FileState) error
- func (spec *Specification) AddPermanentPlug(iface interfaces.Interface, plug *snap.PlugInfo) error
- func (spec *Specification) AddPermanentSlot(iface interfaces.Interface, slot *snap.SlotInfo) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct{}
Backend is responsible for maintaining configfiles cache.
func (*Backend) Initialize ¶
func (b *Backend) Initialize(opts *interfaces.SecurityBackendOptions) error
Initialize does nothing for this backend.
func (*Backend) Name ¶
func (b *Backend) Name() interfaces.SecuritySystem
Name returns the name of the backend.
func (*Backend) NewSpecification ¶
func (b *Backend) NewSpecification(*interfaces.SnapAppSet, interfaces.ConfinementOptions) interfaces.Specification
NewSpecification returns a new specification associated with this backend.
func (*Backend) Remove ¶
Remove removes modules configfiles files specific to a given snap. This method should be called after removing a snap.
If the method fails it should be re-tried (with a sensible strategy) by the caller.
func (*Backend) SandboxFeatures ¶
SandboxFeatures returns the list of features supported by snapd for configfiles.
func (*Backend) Setup ¶
func (b *Backend) Setup(appSet *interfaces.SnapAppSet, opts interfaces.ConfinementOptions, repo *interfaces.Repository, tm timings.Measurer) error
Setup will make the configfiles backend generate the specified configuration files.
If the method fails it should be re-tried (with a sensible strategy) by the caller.
type Specification ¶
type Specification struct {
// contains filtered or unexported fields
}
Specification assists in collecting paths and content associated with an interface.
Unlike the Backend itself (which is stateless and non-persistent) this type holds internal state that is used by the configfiles backend during the interface setup process.
func (*Specification) AddConnectedPlug ¶
func (spec *Specification) AddConnectedPlug(iface interfaces.Interface, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error
AddConnectedPlug records configfiles-specific side-effects of having a connected plug.
func (*Specification) AddConnectedSlot ¶
func (spec *Specification) AddConnectedSlot(iface interfaces.Interface, plug *interfaces.ConnectedPlug, slot *interfaces.ConnectedSlot) error
AddConnectedSlot records configfiles-specific side-effects of having a connected slot.
func (*Specification) AddPathContent ¶
func (spec *Specification) AddPathContent(path string, state osutil.FileState) error
AddPathContent adds a configuration file with its content to the specification.
func (*Specification) AddPermanentPlug ¶
func (spec *Specification) AddPermanentPlug(iface interfaces.Interface, plug *snap.PlugInfo) error
AddPermanentPlug records configfiles-specific side-effects of having a plug.
func (*Specification) AddPermanentSlot ¶
func (spec *Specification) AddPermanentSlot(iface interfaces.Interface, slot *snap.SlotInfo) error
AddPermanentSlot records configfiles-specific side-effects of having a slot.