Documentation ¶
Overview ¶
Package config defines the constants and functions necessary to parse configuration files for bgpmon
Index ¶
Constants ¶
const ( CochroachSession = sessionType(iota) PostgresSession )
These are the session types currently supported
const ( // DefaultRPCTimeoutSecs is the maximum lifetime for an RPC call defaults to 4 minutes DefaultRPCTimeoutSecs = 240 // DefaultRPCAddress is the default address:port for the RPC server DefaultRPCAddress = ":12289" // DefaultDBTimeoutSecs is the maximum lifetime for a DB operation defaults to 4 minutes DefaultDBTimeoutSecs = 240 // DefaultSuggestedNodeFile is the file created by PutConfiguredNodes DefaultSuggestedNodeFile = "suggested_nodes.toml" )
Variables ¶
This section is empty.
Functions ¶
func PutConfiguredNodes ¶
func PutConfiguredNodes(a map[string]NodeConfig) error
PutConfiguredNodes writes a node configuration in the TOML format to w
func SumNodeConfs ¶
func SumNodeConfs(confnodes, dbnodes map[string]NodeConfig) map[string]NodeConfig
SumNodeConfs combines two maps of NodeConfigs, preferring the first in case of overlap
Types ¶
type Configer ¶
type Configer interface { GetSessionConfigs() []SessionConfiger GetSessionConfigWithName(string) (SessionConfiger, error) GetConfiguredNodes() map[string]NodeConfig GetModules() []ModuleConfig }
Configer describes the configuration for a bgpmond server
type EntityConfig ¶
EntityConfig contains an entity that was specified in a configuration file.
func NewEntityConfigFromJSONFile ¶
func NewEntityConfigFromJSONFile(fName string) (*EntityConfig, error)
NewEntityConfigFromJSONFile populates an entity config specified in the provided JSON file.
type ModuleConfig ¶
ModuleConfig describes a module configuration
func (ModuleConfig) GetArgs ¶
func (m ModuleConfig) GetArgs() map[string]string
GetArgs returns the arguments passed to the module
func (ModuleConfig) GetID ¶
func (m ModuleConfig) GetID() string
GetID returns the ID of the module, specified as the map key
func (ModuleConfig) GetType ¶
func (m ModuleConfig) GetType() string
GetType returns the type of a module in the config
type NodeConfig ¶
type NodeConfig struct { IP string Name string IsCollector bool DumpDurationMinutes int Description string Coords string Location string }
NodeConfig describes a BGP node, either a collector or a peer.
type SessionConfiger ¶
type SessionConfiger interface { Configer GetHostNames() []string GetName() string GetDatabaseName() string GetTypeName() string GetUser() string GetPassword() string GetCertDir() string GetWorkerCt() int GetDBTimeoutSecs() int }
SessionConfiger describes the configuration for a bgpmond session