Documentation
¶
Index ¶
Constants ¶
View Source
const ( //Init happens before handshake AfterInit = After("init") //Core happens with core is up and running (also networking) AfterNet = After("net") //Default for startup commands that doesn't specify dependency AfterBoot = After("boot") ToTheEnd = After("----") )
View Source
const (
//ConfigSuffix config file ext
ConfigSuffix = ".toml"
)
Variables ¶
Functions ¶
func LoadSettings ¶
GetSettings loads main settings from a filename
Types ¶
type AppSettings ¶
type AppSettings struct {
Main struct {
MaxJobs int `json:"max_jobs"`
Include []string `json:"include"`
Network string `json:"network"`
LogLevel string `json:"log_level"`
} `json:"main"`
Globals Globals `json:"globals"`
Extension map[string]Extension `json:"extension"`
Logging map[string]Logger `json:"logger"`
Stats struct {
//Interval is deprecated
Interval int `json:"interval"`
Redis struct {
Enabled bool `json:"enabled"`
FlushInterval int `json:"flush_interval"` //in seconds
Address string `json:"address"`
} `json:"redis"`
} `json:"stats"`
}
Settings main agent settings
var Settings AppSettings
func (*AppSettings) GetIncludedSettings ¶
func (s *AppSettings) GetIncludedSettings() (partial *IncludedSettings, errors []error)
GetPartialSettings loads partial settings according to main configurations
func (*AppSettings) Validate ¶
func (s *AppSettings) Validate() []error
type Extension ¶
type Extension struct {
//binary to execute
Binary string `json:"binary"`
//script search path
Cwd string `json:"cwd"`
//(optional) Env variables
Env map[string]string `json:"env"`
Args []string `json:"args"`
// contains filtered or unexported fields
}
Extension cmd config
type IncludedSettings ¶
type IncludedSettings struct {
Extension map[string]Extension
Startup map[string]Startup
// contains filtered or unexported fields
}
func (*IncludedSettings) GetStartupTree ¶
func (i *IncludedSettings) GetStartupTree() (StartupTree, []error)
type Logger ¶
type Logger struct {
//logger type, now only 'db' and 'ac' are supported
Type string `json:"type"`
//list of controlles base URLs
Controllers []string `json:"controllers"`
//Process which levels
Levels []int `json:"levels"`
//Log address (for loggers that needs it)
Address string `json:"address"`
//Flush interval (for loggers that needs it)
FlushInt int `json:"flush_int"`
//Flush batch size (for loggers that needs it)
BatchSize int `json:"batch_size"`
}
Logger settings
type Security ¶
type Security struct {
CertificateAuthority string
ClientCertificate string
ClientCertificateKey string
}
Security certificate path
type Startup ¶
type Startup struct {
After []string
RunningDelay int
RunningMatch string
RecurringPeriod int
MaxRestart int
Protected bool
Name string
Args map[string]interface{}
// contains filtered or unexported fields
}
StartupCmd startup command config
type StartupSlice ¶
type StartupSlice []Startup
type StartupTree ¶
type StartupTree interface {
//Services a list of sorted startup services based on service weights.
Services() []Startup
//Slice gets a slice of the sorted start up processes that are lying between a
//certain weight range. e can be set to -1 which means (end of list)
//[s, e[
Slice(s, e int64) StartupSlice
}
Click to show internal directories.
Click to hide internal directories.