Documentation ¶
Overview ¶
Package configstate implements the manager and state aspects responsible for the configuration of snaps.
Index ¶
- func Configure(st *state.State, snapName string, patch map[string]interface{}, flags int) *state.TaskSet
- func ConfigureHookTimeout() time.Duration
- func ConfigureInstalled(st *state.State, snapName string, patch map[string]interface{}, flags int) (*state.TaskSet, error)
- func ContextTransaction(context *hookstate.Context) *config.Transaction
- func EarlyConfig(st *state.State, preloadGadget func() (sysconfig.Device, *gadget.Info, error)) error
- func Init(st *state.State, hookManager *hookstate.HookManager) error
- func MockConfigcoreRun(f func(sysconfig.Device, config.Conf) error) (restore func())
- func RemapSnapFromRequest(snapName string) string
- func RemapSnapToResponse(snapName string) string
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 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 MockConfigcoreRun ¶
func RemapSnapFromRequest ¶
RemapSnapFromRequest renames a snap as received from an API request
func RemapSnapToResponse ¶
RemapSnapToResponse renames a snap as about to be sent from an API response
Types ¶
This section is empty.