Documentation ¶
Index ¶
- type APIGet
- type Client
- type ClientConfig
- type ClientState
- type ClientStatus
- type Config
- type ConfigItem
- type JsonApp
- type Manager
- func (self *Manager) Clean() (errs []error)
- func (self *Manager) ClientClean() (errs []error)
- func (self *Manager) ClientDelete(configName string, instance string) error
- func (self *Manager) ClientDown(config *ClientConfig) (errs []error)
- func (self *Manager) ClientUp(config *ClientConfig) (errs []error)
- func (self *Manager) ConfigGet(id config.ID) (config.Config, error)
- func (self *Manager) ConfigList(filter config.ID) (configs []ConfigItem, err error)
- func (self *Manager) ConfigPush(id config.ID, pushConfig config.Config) error
- func (self *Manager) Discover() (err error)
- func (self *Manager) DumpConfig() (string, error)
- func (self *Manager) GetClient(config string, instance string) (*Client, error)
- func (self *Manager) ListClients() (clients []ClientStatus, err error)
- func (self *Manager) ListWorkers() (workers []WorkerStatus, err error)
- func (self *Manager) LoadConfigFile(filePath string) error
- func (self *Manager) LoadConfigReader(reader io.Reader) error
- func (self *Manager) LoadConfigString(data string) error
- func (m *Manager) NewAuth(filePath string) (*rest.AuthBasicMiddleware, error)
- func (self *Manager) Panic() error
- func (self *Manager) RestApp() (rest.App, error)
- func (self *Manager) Start() (errs []error)
- func (self *Manager) Stop() (errs []error)
- func (self *Manager) WorkerClean() (errs []error)
- func (self *Manager) WorkerDelete(configName string, instance string) error
- func (self *Manager) WorkerDown(config *WorkerConfig) (errs []error)
- func (self *Manager) WorkerGet(configName string, instance string) (*WorkerStatus, error)
- func (self *Manager) WorkerUp(workerConfig *WorkerConfig) (errs []error)
- type ManagerAPI
- type Options
- type WebApp
- func (self *WebApp) Delete(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) DeleteClients(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) DeleteWorkers(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) Get(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetConfig(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetConfigList(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetDocker(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetDockerInfo(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetDockerList(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetDockerLogs(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetStats(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetStatsList(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetStatsTypes(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) GetWorker(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) Post(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) PostClean(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) PostConfig(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) PostPanic(w rest.ResponseWriter, req *rest.Request)
- func (self *WebApp) PostStop(w rest.ResponseWriter, req *rest.Request)
- type Worker
- type WorkerConfig
- type WorkerState
- type WorkerStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIGet ¶
type APIGet struct { Config Config `json:"config"` ConfigText string `json:"config_text"` Clients []ClientStatus `json:"clients"` Workers []WorkerStatus `json:"workers"` }
type Client ¶
type Client struct { Config *ClientConfig Instance string // contains filtered or unexported fields }
type ClientConfig ¶
type ClientConfig struct { Count uint Image string Privileged bool Volume string VolumePath string VolumeFmtID string VolumeReadonly bool // contains filtered or unexported fields }
func (ClientConfig) String ¶
func (self ClientConfig) String() string
type ClientState ¶
type ClientState string
var ClientDown ClientState = "down"
var ClientError ClientState = "error"
var ClientUp ClientState = "up"
type ClientStatus ¶
type Config ¶
type Config struct { Clients map[string]*ClientConfig Workers map[string]*WorkerConfig }
full-system configuration
type ConfigItem ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) ClientClean ¶
Cleanup down'd clients
func (*Manager) ClientDelete ¶
func (*Manager) ClientDown ¶
func (self *Manager) ClientDown(config *ClientConfig) (errs []error)
Stop running clients clients for given config
Call with config=nil to stop all clients
func (*Manager) ClientUp ¶
func (self *Manager) ClientUp(config *ClientConfig) (errs []error)
Start up all configured clients
func (*Manager) ConfigList ¶
func (self *Manager) ConfigList(filter config.ID) (configs []ConfigItem, err error)
func (*Manager) ConfigPush ¶
func (*Manager) Discover ¶
Discover any existing running docker containers before initial Start() Must be run after loadConfig() to recognize any containers.. Allows Start() to re-use existing containers, and cleanup undesired containers
func (*Manager) DumpConfig ¶
Get running configuration
func (*Manager) ListClients ¶
func (self *Manager) ListClients() (clients []ClientStatus, err error)
func (*Manager) ListWorkers ¶
func (self *Manager) ListWorkers() (workers []WorkerStatus, err error)
func (*Manager) LoadConfigFile ¶
func (*Manager) LoadConfigString ¶
func (*Manager) NewAuth ¶
func (m *Manager) NewAuth(filePath string) (*rest.AuthBasicMiddleware, error)
func (*Manager) WorkerClean ¶
Cleanup down'd workers
func (*Manager) WorkerDelete ¶
func (*Manager) WorkerDown ¶
func (self *Manager) WorkerDown(config *WorkerConfig) (errs []error)
Stop running workers for given config
Call with config=nil to stop all workers.
func (*Manager) WorkerGet ¶
func (self *Manager) WorkerGet(configName string, instance string) (*WorkerStatus, error)
func (*Manager) WorkerUp ¶
func (self *Manager) WorkerUp(workerConfig *WorkerConfig) (errs []error)
Setup workers from config
type ManagerAPI ¶
type ManagerAPI interface { Start() []error Stop() []error Clean() []error DumpConfig() (string, error) ConfigList(config.ID) ([]ConfigItem, error) ConfigGet(config.ID) (config.Config, error) ConfigPush(config.ID, config.Config) error ListClients() ([]ClientStatus, error) ListWorkers() ([]WorkerStatus, error) WorkerGet(string, string) (*WorkerStatus, error) WorkerDelete(string, string) error ClientDelete(string, string) error LoadConfigReader(io.Reader) error Panic() error }
type WebApp ¶
type WebApp struct {
// contains filtered or unexported fields
}
func (*WebApp) DeleteClients ¶
func (self *WebApp) DeleteClients(w rest.ResponseWriter, req *rest.Request)
func (*WebApp) DeleteWorkers ¶
func (self *WebApp) DeleteWorkers(w rest.ResponseWriter, req *rest.Request)
func (*WebApp) GetConfigList ¶
func (self *WebApp) GetConfigList(w rest.ResponseWriter, req *rest.Request)
func (*WebApp) GetDockerInfo ¶
func (self *WebApp) GetDockerInfo(w rest.ResponseWriter, req *rest.Request)
func (*WebApp) GetDockerList ¶
func (self *WebApp) GetDockerList(w rest.ResponseWriter, req *rest.Request)
func (*WebApp) GetDockerLogs ¶
func (self *WebApp) GetDockerLogs(w rest.ResponseWriter, req *rest.Request)
func (*WebApp) GetStats ¶
func (self *WebApp) GetStats(w rest.ResponseWriter, req *rest.Request)
- Query stats series for data points, for either a given field or all fields. *
- Each field is returned separately. *
- This information is temporal, it changes continuously for active series.
[
{ "type": "udp_send", "hostname": "close-client-openvpn-1", "instance": "15042208547977655843", "field": "rate", "points": [ { "time": "2016-01-26T10:01:12.108997292Z", "value": 10.00012210149086 } ] }
]
func (*WebApp) GetStatsList ¶
func (self *WebApp) GetStatsList(w rest.ResponseWriter, req *rest.Request)
- Query a list of stats series, optionally for a given type (InfluxDB series (tag-sets), for a given measurement). *
- This information is dynamic, it changes if new workers are started. *
- TODO: cleanup/hide old series that are no longer active, i.e. expire after some time?
[
{ "type": "udp_recv", "hostname": "catcp-terom-dev", "instance": "127.0.0.1:1337" },
]
func (*WebApp) GetStatsTypes ¶
func (self *WebApp) GetStatsTypes(w rest.ResponseWriter, req *rest.Request)
* Query a list of available stats types (InfluxDB measurements and their fields). * * This information is static, it only changes if the code changes to introduce new types/fields (or old measurememts are dropped). *
[ { "type": "icmp_latency", "fields": [ "rtt" ] } ]
func (*WebApp) PostConfig ¶
func (self *WebApp) PostConfig(w rest.ResponseWriter, req *rest.Request)
type Worker ¶
type Worker struct { Config *WorkerConfig Instance string // contains filtered or unexported fields }
track state of managed workers
type WorkerConfig ¶
type WorkerConfig struct { Count uint Client string // ClientConfig.name // Docker Constraints []string Image string Privileged bool Command string Args []string // worker Type string InstanceFlag string /* * Stats URL: type [ "/" field ] [ "?" ("instance=" ("$" | "$" configName ) ) [ "&" ... ] ] */ Stats string RateConfig string RateStats string LatencyStats string // contains filtered or unexported fields }
func (WorkerConfig) String ¶
func (self WorkerConfig) String() string
type WorkerState ¶
type WorkerState string
var WorkerDown WorkerState = "down" // not running, clean exit
var WorkerError WorkerState = "error" // not running, unclean exit
var WorkerUnknown WorkerState = "unknown" // running, unknown
var WorkerUp WorkerState = "up" // running, ready
var WorkerWait WorkerState = "wait" // running, pending
type WorkerStatus ¶
type WorkerStatus struct { Config string `json:"config"` // WorkerConfig.name Instance string `json:"instance"` WorkerConfig *WorkerConfig `json:"worker_config,omitempty"` // detail Docker string `json:"docker"` DockerStatus string `json:"docker_status"` DockerNode string `json:"docker_node"` DockerContainer *docker.Container `json:"docker_container,omitempty"` // detail Up bool `json:"up"` State WorkerState `json:"state"` ConfigInstance string `json:"config_instance"` ConfigError string `json:"config_error,omitempty"` ConfigTTL float64 `json:"config_ttl"` // seconds ConfigMap config.ConfigMap `json:"config_map,omitempty"` // detail StatsMeta stats.SeriesKey `json:"stats_meta"` RateConfig uint `json:"rate_config,omitempty"` // config RateStats *stats.SeriesStats `json:"rate_stats,omitempty"` LatencyStats *stats.SeriesStats `json:"latency_stats,omitempty"` }