Documentation ¶
Overview ¶
Package config handles agent configuration from a config file. It also defines the valid actions along with their types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ValidActions is a whitelist of configurable actions and their types ValidActions = map[string]ActionType{ "create": AsyncAction, "containerCreate": AsyncAction, "delete": AsyncAction, "containerDelete": AsyncAction, "containerStart": AsyncAction, "reboot": AsyncAction, "containerReboot": AsyncAction, "restart": AsyncAction, "containerRestart": AsyncAction, "poweroff": AsyncAction, "containerPoweroff": AsyncAction, "shutdown": AsyncAction, "containerShutdown": AsyncAction, "start": AsyncAction, "cpuMetrics": InfoAction, "nicMetrics": InfoAction, "diskMetrics": InfoAction, "listImages": InfoAction, "containerListImages": InfoAction, "getImage": InfoAction, "containerGetImage": InfoAction, "deleteImage": AsyncAction, "containerDeleteImage": AsyncAction, "fetchImage": AsyncAction, "containerFetchImage": AsyncAction, "listSnapshots": InfoAction, "getSnapshot": InfoAction, "createSnapshot": AsyncAction, "deleteSnapshot": AsyncAction, "rollbackSnapshot": AsyncAction, "downloadSnapshot": StreamAction, } )
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Type ActionType Stages []Stage `json:"stages"` }
Action is a set of stages and how they should be handled
type ActionType ¶
type ActionType int
ActionType describes synchronicity of an action
const ( // InfoAction is for synchronous information retrieval in JSON format InfoAction ActionType = iota // StreamAction is for synchronous data streaming StreamAction // AsyncAction is for asynchronous actions AsyncAction )
type Config ¶
type Config struct { Actions map[string]Action `json:"actions"` Services map[string]Service `json:"services"` DBPath string `json:"dbpath"` }
Config contains all of the configuration data
Click to show internal directories.
Click to hide internal directories.