Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetaHook ¶
type MetaHook struct {
// contains filtered or unexported fields
}
*
- MetaHook is a component to update the MetaConfiguration
- over a controlled HTTP API *
- It uses a updateHookMap to specify callback functions
- for specific MetaConfig keys, those callbacks can be used
- to live-update the configuration in the components. *
- MetaHook launches a HTTP API over a UNIX socket on the specified location *
- Main purpose for this API is that infrastructure controllers like juju
- can manage the MetaConfig at runtime.
func CreateMetaHook ¶
func CreateMetaHook( socketpath string, socketperm fs.FileMode, updatehooks UpdateHooks, config *metaconfig.MetaConfig) (*MetaHook, error)
*
- Initialize MetaHook API
type UpdateHooks ¶
type UpdateHooks struct { // Hooks for string fields StringFieldHooks map[string]func(string, string) error // Hooks for bool fields BoolFieldHooks map[string]func(string, bool) error // Hooks for double fields DoubleFieldHooks map[string]func(string, float64) error // Hooks for list fields ListFieldHooks map[string]func(string, []string) error }
*
- Structure which holds function definitions for specific MetaConfig fields *
- The hook function callback is called when the API is called to change the specified MetaConfig field. *
- Every hook is executed synchroniously, make sure they do not use cost-intensive IO operations. *
- Hooks are expected to bring the system into a state where it operates like
- the field was set at application start!
Click to show internal directories.
Click to hide internal directories.