features

package
v2.42.5-go-mod+incompa... Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SnapdFeature

type SnapdFeature int

SnapdFeature is a named feature that may be on or off.

const (
	// Layouts controls availability of snap layouts.
	Layouts SnapdFeature = iota
	// ParallelInstances controls availability installing a snap multiple times.
	ParallelInstances
	// Hotplug controls availability of dynamically creating slots based on system hardware.
	Hotplug
	// SnapdSnap controls possibility of installing the snapd snap.
	SnapdSnap
	// PerUserMountNamespace controls the persistence of per-user mount namespaces.
	PerUserMountNamespace
	// RefreshAppAwareness controls refresh being aware of running applications.
	RefreshAppAwareness
	// RobustMountNamespaceUpdates controls how snap-update-ns updates existing mount namespaces.
	RobustMountNamespaceUpdates
)

func KnownFeatures

func KnownFeatures() []SnapdFeature

KnownFeatures returns the list of all known features.

func (SnapdFeature) ConfigOption

func (f SnapdFeature) ConfigOption() (snapName, confName string)

ConfigOption returns the snap name and configuration option associated with this feature.

func (SnapdFeature) ControlFile

func (f SnapdFeature) ControlFile() string

ControlFile returns the path of the file controlling the exported feature.

Snapd considers the feature enabled if the file is present. The contents of the file are not important.

The function panics for features that are not exported.

func (SnapdFeature) IsEnabled

func (f SnapdFeature) IsEnabled() bool

IsEnabled checks if a given exported snapd feature is enabled.

The function panics for features that are not exported.

func (SnapdFeature) IsEnabledWhenUnset

func (f SnapdFeature) IsEnabledWhenUnset() bool

IsEnabledWhenUnset returns true if a feature is enabled when not set.

A feature may be enabled or disabled with explicit state in snapd. If explicit state is absent the effective value is the implicit default computed by this function.

func (SnapdFeature) IsExported

func (f SnapdFeature) IsExported() bool

IsExported returns true if a feature is copied from snapd state to a feature file.

Certain features are available outside of snapd internal state and visible as control files in a dedicated directory. Such features can be queried for, via IsEnabled, outside of snapd.

func (SnapdFeature) String

func (f SnapdFeature) String() string

String returns the name of a snapd feature. The function panics for bogus feature values.

Jump to

Keyboard shortcuts

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