Documentation ¶
Overview ¶
Package config reads a configuration file and generates an instance of Configuration. A description of the expected fields can be found in the BFF wiki.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Directions []Direction `json:"directions"` ListenAddress string `json:"listen address"` ListenType string `json:"listen type"` DashboardAddress string `json:"dashboard address"` AcceptedSources []string `json:"accepted sources"` Log string `json:"log"` }
Configuration is a struct that mirrors the data as it should be found in the configuration file.
func ReadConfig ¶
func ReadConfig(filename string) (*Configuration, error)
ReadConfig parses a configuration file and returns an instance of Configuration.
func (*Configuration) Validate ¶
func (c *Configuration) Validate() error
Validate returns a list of validation errors, if any.
type Direction ¶
type Direction struct { Name string `json:"name"` Typ string `json:"type"` WindowSize float64 `json:"window size"` MaxHits float64 `json:"max hits"` CleanUpTime float64 `json:"clean up time"` MaxTracked float64 `json:"max tracked"` }
Direction is a struct that mirrors the direction objects as they should be found in the configuration file.
Click to show internal directories.
Click to hide internal directories.