Documentation ¶
Index ¶
- Constants
- func SanitizeAndSplitLine(input string) []string
- type AutonomousSystem
- type Config
- type ConfigExtension
- type ConfigFactory
- func (c *ConfigFactory) DecodeRawConfig(r io.Reader) (*Config, error)
- func (c *ConfigFactory) Init()
- func (c *ConfigFactory) New(self *RouteController, connectedRouteControllers []RouteController, ...) *Config
- func (c *ConfigFactory) ReadConfigPaths(paths []string, extension ConfigExtension) (map[string]Config, error)
- type RouteController
Constants ¶
View Source
const (
// DefaultPort ...
DefaultPort = 1450
)
View Source
const ProtocolVersion = 1
ProtocolVersion ...
Variables ¶
This section is empty.
Functions ¶
func SanitizeAndSplitLine ¶
SanitizeAndSplitLine ...
Types ¶
type AutonomousSystem ¶
type AutonomousSystem struct { Number int `json:"number" mapstructure:"number"` LinkCapacity int `json:"link_capacity" mapstructure:"link_capacity"` Cost int `json:"cost" mapstructure:"cost"` }
AutonomousSystem ...
func ExtractAutonomousSystemFromLine ¶
func ExtractAutonomousSystemFromLine(input string) (*AutonomousSystem, error)
ExtractAutonomousSystemFromLine ...
type Config ¶
type Config struct { DevelopmentMode bool `json:"development_mode" mapstructure:"development_mode"` Protocol int `json:"protocol" mapstructure:"protocol"` Port int `json:"port" mapstructure:"port"` MinPeers int `json:"min_peers" mapstructure:"min_peers"` MaxPeers int `json:"max_peers" mapstructure:"max_peers"` Cron string `json:"cron" mapstructure:"cron"` CostEstimatorPath string `json:"cost_estimator_path" mapstructure:"cost_estimator_path"` LogLevel string `json:"log_level" mapstructure:"log_level"` Self *RouteController `json:"self" mapstructure:"self"` ConnectedRouteControllers []RouteController `json:"connected_route_controllers" mapstructure:"connected_route_controllers"` ConnectedAutonomousSystems []AutonomousSystem `json:"connected_autonomous_systems" mapstructure:"connected_autonomous_systems"` }
Config ...
type ConfigExtension ¶
type ConfigExtension int
ConfigExtension ...
const ( // JSON ... JSON ConfigExtension = iota // TOML ... TOML // XML ... XML // CONF ... CONF )
type ConfigFactory ¶
type ConfigFactory struct { sync.Once DevelopmentMode bool `json:"development_mode" mapstructure:"development_mode"` Protocol int `json:"protocol" mapstructure:"protocol"` Port int `json:"port" mapstructure:"port"` Cron string `json:"cron" mapstructure:"cron"` LogLevel string `json:"log_level" mapstructure:"log_level"` MinPeers int `json:"min_peers" mapstructure:"min_peers"` MaxPeers int `json:"max_peers" mapstructure:"max_peers"` }
ConfigFactory is used to add extra metadata the server needs to a config struct parsed from raw config file
func (*ConfigFactory) DecodeRawConfig ¶
func (c *ConfigFactory) DecodeRawConfig(r io.Reader) (*Config, error)
DecodeRawConfig ...
func (*ConfigFactory) New ¶
func (c *ConfigFactory) New(self *RouteController, connectedRouteControllers []RouteController, connectedAutonomousSystems []AutonomousSystem) *Config
New returns a new config struct
func (*ConfigFactory) ReadConfigPaths ¶
func (c *ConfigFactory) ReadConfigPaths(paths []string, extension ConfigExtension) (map[string]Config, error)
ReadConfigPaths ...
type RouteController ¶
type RouteController struct { ID int `json:"id" mapstructure:"id"` AutonomousSystemNumber int `json:"autonomous_system_number" mapstructure:"autonomous_system_number"` IP string `json:"ip" mapstructure:"ip"` }
RouteController ...
func ExtractRouteControllerFromLine ¶
func ExtractRouteControllerFromLine(input string) (*RouteController, error)
ExtractRouteControllerFromLine ...
Click to show internal directories.
Click to hide internal directories.