config

package
v0.0.0-...-7ede39d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2017 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchRemoteList

func FetchRemoteList(
	gl *Global,
	maxNumRemoteTargets int,
	maxNumSrcTCPPorts uint16,
	minBatchInterval time.Duration,
	HTTPResponseHeaderTimeout time.Duration,
	orchestratorRESTConf string,
	kill chan struct{},
	logger zap.Logger,
) error

FetchRemoteList fetches the configuration file from local path or, remotely, from Arachne Orchestrator.

func GetHostname

func GetHostname(logger zap.Logger) (string, error)

GetHostname returns the hostname.

func ResolveDnsTargets

func ResolveDnsTargets(
	remotes RemoteStore,
	grc *RemoteConfig,
	DNSRefresh *time.Ticker,
	wg *sync.WaitGroup,
	kill chan struct{},
	logger zap.Logger,
)

ResolveDnsTargets resolves the DNS names of the IP addresses of all echo targets and the localhost.

Types

type AppConfig

type AppConfig struct {
	Logging                log.Config
	Verbose                bool
	PIDPath                string
	Orchestrator           OrchestratorConfig
	StandaloneTargetConfig string
	Metrics                metrics.Config
}

AppConfig holds the info parsed from the local YAML config file.

func Get

func Get(cf string, ec *Extended, logger zap.Logger) (*AppConfig, error)

Get fetches the configuration file from local path.

type ArachneConfiguration

type ArachneConfiguration struct {
	PIDPath                string             `yaml:"pidPath"`
	Orchestrator           OrchestratorConfig `yaml:"orchestrator"`
	StandaloneTargetConfig string             `yaml:"standaloneTargetConfig"`
}

ArachneConfiguration contains specific configuration to Arachne.

type BasicConfig

type BasicConfig struct {
	Logging log.Config           `yaml:"logging"`
	Arachne ArachneConfiguration `yaml:"arachne"`
}

BasicConfig holds the basic parameter configurations for the application.

type CLIConfig

type CLIConfig struct {
	ConfigFile       *string
	Foreground       *bool
	ReceiverOnlyMode *bool
	SenderOnlyMode   *bool
}

CLIConfig holds the info parsed from CLI.

func ParseCliArgs

func ParseCliArgs(logger zap.Logger, service string, version string) *CLIConfig

ParseCliArgs provides the usage and help menu, and parses the actual arguments.

type Extended

type Extended struct {
	Metrics metrics.Opt
}

Extended holds the parameter configurations implemented by outside callers.

type Global

type Global struct {
	App          *AppConfig
	CLI          *CLIConfig
	RemoteConfig *RemoteConfig
	Remotes      RemoteStore
}

Global holds the global application info.

type OrchestratorConfig

type OrchestratorConfig struct {
	Enabled     bool   `yaml:"enabled"`
	AddrPort    string `yaml:"addrport"`
	RESTVersion string `yaml:"restVersion"`
}

OrchestratorConfig contains configuration for the Arachne Orchestrator.

type Remote

type Remote struct {
	IP       net.IP
	AF       string
	Hostname string
	External bool
}

Remote holds the info for every target to be echoed.

type RemoteConfig

type RemoteConfig struct {
	Region                   string
	HostName                 string
	SrcAddress               net.IP
	SrcTCPPortRange          tcp.PortRange
	InterfaceName            string
	TargetTCPPort            uint16
	Timeout                  time.Duration
	BatchInterval            time.Duration
	QoSEnabled               bool
	ResolveDNS               bool
	DNSServersAlt            []net.IP
	PollOrchestratorInterval pollInterval
}

RemoteConfig holds the info parsed from the JSON config file.

type RemoteFileConfig

type RemoteFileConfig struct {
	Local struct {
		Region                          string `json:"region"`
		HostName                        string `json:"host_name"`
		SrcAddress                      string `json:"src_address"`
		InterfaceName                   string `json:"interface_name"`
		TargetTCPPort                   uint16 `json:"target_tcp_port"`
		Timeout                         string `json:"timeout"`
		BaseSrcTCPPort                  uint16 `json:"base_src_tcp_port"`
		NumSrcTCPPorts                  uint16 `json:"num_src_tcp_ports"`
		BatchInterval                   string `json:"batch_interval"`
		QoSEnabled                      string `json:"qos"`
		ResolveDNS                      string `json:"resolve_dns"`
		DNSServersAlt                   string `json:"dns_servers_alternate"`
		PollOrchestratorIntervalSuccess string `json:"poll_orchestrator_interval_success"`
		PollOrchestratorIntervalFailure string `json:"poll_orchestrator_interval_failure"`
	} `json:"local"`
	Internal []target `json:"internal"`
	External []target `json:"external"`
}

RemoteFileConfig needed for the JSON decoder to know which fields to expect and parse.

type RemoteStore

type RemoteStore map[string]Remote

RemoteStore holds all Remotes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL