configstate

package
v0.0.0-...-9e584df Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package configstate implements the manager and state aspects responsible for the configuration of snaps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(st *state.State, snapName string, patch map[string]interface{}, flags int) *state.TaskSet

Configure returns a taskset to apply the given configuration patch.

func ConfigureHookTimeout

func ConfigureHookTimeout() time.Duration

func ConfigureInstalled

func ConfigureInstalled(st *state.State, snapName string, patch map[string]interface{}, flags int) (*state.TaskSet, error)

ConfigureInstalled returns a taskset to apply the given configuration patch for an installed snap. It returns snap.NotInstalledError if the snap is not installed.

func ContextTransaction

func ContextTransaction(context *hookstate.Context) *config.Transaction

ContextTransaction retrieves the transaction cached within the context (and creates one if it hasn't already been cached).

func EarlyConfig

func EarlyConfig(st *state.State, preloadGadget func() (sysconfig.Device, *gadget.Info, error)) error

EarlyConfig performs any needed early configuration handling during managers' startup, it is exposed as a hook to devicestate for invocation. preloadGadget if set will be invoked if the system is not yet seeded or configured, it should either return ErrNoState, or return the gadget.Info for the to-be-seeded gadget and details about the model/device as sysconfig.Device.

func Init

func Init(st *state.State, hookManager *hookstate.HookManager) error

func MockConfigcoreRun

func MockConfigcoreRun(f func(sysconfig.Device, config.Conf) error) (restore func())

func RemapSnapFromRequest

func RemapSnapFromRequest(snapName string) string

RemapSnapFromRequest renames a snap as received from an API request

func RemapSnapToResponse

func RemapSnapToResponse(snapName string) string

RemapSnapToResponse renames a snap as about to be sent from an API response

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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