configcore

package
v0.0.0-...-20647f5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: GPL-3.0 Imports: 56 Imported by: 40

Documentation

Index

Constants

View Source
const HOST_NAME_MAX = 64

Note that HOST_NAME_MAX is 64 on Linux, but DNS allows domain names up to 255 characters

Variables

View Source
var (
	Stdout = os.Stdout
	Stderr = os.Stderr
)

Functions

func Early

func Early(dev sysconfig.Device, cfg RunTransaction, values map[string]interface{}) error

func ExportExperimentalFlags

func ExportExperimentalFlags(tr ConfGetter) error

func IsSupportedExperimentalFlag

func IsSupportedExperimentalFlag(flag string) bool

IsSupportedExperimentalFlag checks if passed flag is a supported experimental feature.

func MockSupportedExperimentalFlags

func MockSupportedExperimentalFlags(flags []string) (restore func())

MockSupportedExperimentalFlags mocks list of supported experimental flags for use in testing.

func Run

func Run(dev sysconfig.Device, cfg RunTransaction) error

Types

type ConfGetter

type ConfGetter interface {
	Get(snapName, key string, result interface{}) error
	GetMaybe(snapName, key string, result interface{}) error
	GetPristine(snapName, key string, result interface{}) error
}

ConfGetter is an interface for reading of config values.

type RunTransaction

type RunTransaction interface {
	Get(snapName, key string, result interface{}) error
	GetMaybe(snapName, key string, result interface{}) error
	GetPristine(snapName, key string, result interface{}) error
	Task() *state.Task
	Set(snapName, key string, value interface{}) error
	Changes() []string
	State() *state.State
	Commit()
}

RunTransaction is an interface describing how to access the system configuration state and transaction.

func NewRunTransaction

func NewRunTransaction(tr *config.Transaction, tk *state.Task) RunTransaction

Jump to

Keyboard shortcuts

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