Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Banner = fmt.Sprintf(` ====|===================> ___ ____ ____ ____ ____ | \ |__/ |__| | __ | | |__/ | \ | | |__] |__| {{ .AnsiColor.Cyan }}%s{{ .AnsiColor.Default }} <===================|==== `, version.GetVersion().VersionNumber())
Banner is a banner to be displayed when the Drago agent is started
Functions ¶
This section is empty.
Types ¶
type ACLConfig ¶
type ACLConfig struct { // Enabled controls if the ACLs are managed and enforced Enabled bool `hcl:"enabled,optional"` }
ACLConfig contains configuration for Drago's ACL
type AdvertiseAddrs ¶
type AdvertiseAddrs struct { // Peer is the address advertised for the purpose // of letting other nodes connect to this node. It // will be used as the WireGuard's endpoint configuration. Peer string `hcl:"peer,optional"` // Server contains the address to be advertised for // the purpose of clustering with other servers. Server string `hcl:"server,optional"` }
AdvertiseAddrs is used to control the addresses a Drago node advertises. All are optional and default to BindAddr and their default Port. Expected format is address:port.
func (*AdvertiseAddrs) Merge ¶
func (c *AdvertiseAddrs) Merge(b *AdvertiseAddrs) *AdvertiseAddrs
Merge merges two AdvertiseAddrs structs, returning the result
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent :
type ClientConfig ¶
type ClientConfig struct { // Enabled controls if the agent is a client Enabled bool `hcl:"enabled,optional"` // Server is the address of a known Drago server in "host:port" format Servers []string `hcl:"servers,optional"` // StateDir is the directory where the client state will be kept StateDir string `hcl:"state_dir,optional"` // InterfacesPrefix is the prefix that will be added to all WireGuard // interfaces managed by Drago InterfacesPrefix string `hcl:"interfaces_prefix,optional"` // WireguardPath is the path to a userspace WireGuard binary, if available WireguardPath string `hcl:"wireguard_path,optional"` // Meta contains metadata about the client node Meta map[string]string `hcl:"meta,optional"` // SyncInterval controls how frequently the client synchronizes its state SyncInterval time.Duration `hcl:"sync_interval,optional"` }
ClientConfig contains configurations for the Drago client
func (*ClientConfig) Merge ¶
func (c *ClientConfig) Merge(b *ClientConfig) *ClientConfig
Merge merges two ClientConfig structs, returning the result
type Config ¶
type Config struct { // StaticFS contains UI bundle to be server by the Drago agent. StaticFS http.FileSystem // UI defines whether or not Drago's web UI will be served // by the agent. Defaults to true. UI bool `hcl:"ui,optional"` // Name is used to identify individual agents. Name string `hcl:"name,optional"` // DataDir is the directory to store our state in. // If not specified, this defaults to /etc/drago. DataDir string `hcl:"data_dir,optional"` // PluginDir is the directory where plugins are loaded from. // If not specified, this defaults to <data_dir>/plugins. PluginDir string `hcl:"plugin_dir,optional"` // BindAddr is the address on which all of Drago's services will // be bound. If not specified, this defaults to 127.0.0.1. BindAddr string `hcl:"bind_addr,optional"` // AdvertiseAddrs is a struct containing the addresses advertised // for each of Drago's network services in host:port format. // It is optional, and all addresses default to the bind address // with the default port corresponding to each service. AdvertiseAddrs *AdvertiseAddrs `hcl:"advertise,block"` // LogLevel is the level of the logs to put out LogLevel string `hcl:"log_level,optional"` // Ports is used to control the network ports we bind to. Ports *Ports `hcl:"ports,block"` // Server contains all server-specific configurations Server *ServerConfig `hcl:"server,block"` // Client contains all client-specific configurations Client *ClientConfig `hcl:"client,block"` // ACL contains all ACL configurations ACL *ACLConfig `hcl:"acl,block"` // DevMode is set by the --dev CLI flag. DevMode *bool // Version information (set at compilation time) Version *version.VersionInfo }
Config contains configurations for the Drago agent
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config struct populated with sane defaults
func EmptyConfig ¶
func EmptyConfig() *Config
EmptyConfig returns an empty Config struct with all nested structs also initialized to a non-nil empty value.
func (*Config) LoadFromFile ¶
LoadFromFile loads the configuration from a given path
type Ports ¶
Ports encapsulates the various ports we bind to for network services. If any are not specified then the defaults are used instead.
type ServerConfig ¶
type ServerConfig struct { // Enabled controls if the agent is a server Enabled bool `hcl:"enabled,optional"` }
ServerConfig contains configurations for the Drago server
func (*ServerConfig) Merge ¶
func (c *ServerConfig) Merge(b *ServerConfig) *ServerConfig
Merge merges two ServerConfig structs, returning the result