configfiles

package
v0.0.0-...-4c8c240 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

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

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

NewSpecification returns a new specification associated with this backend.

func (*Backend) Remove

func (b *Backend) Remove(snapName string) error

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

func (b *Backend) SandboxFeatures() []string

SandboxFeatures returns the list of features supported by snapd for configfiles.

func (*Backend) Setup

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL