config

package
v7.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Port                  uint     `json:"port"`
	Monitors              []*URL   `json:"monitors"`
	ReqTimeout            Duration `json:"request_timeout_ms"`
	CRConfigInterval      Duration `json:"crconfig_poll_interval_ms"`
	CRStatesInterval      Duration `json:"crstates_poll_interval_ms"`
	CDN                   string   `json:"cdn"`
	TrafficOpsURI         *URL     `json:"traffic_ops_uri"`
	TrafficOpsUser        string   `json:"traffic_ops_user"`
	TrafficOpsPass        string   `json:"traffic_ops_pass"`
	TrafficOpsInsecure    bool     `json:"traffic_ops_insecure"`
	TrafficOpsClientCache bool     `json:"traffic_ops_client_cache"`
	TrafficOpsTimeout     Duration `json:"traffic_ops_timeout_ms"`
	CoverageZoneFile      string   `json:"coverage_zone_file"`
	LogLocations
}

func Load

func Load(filename string) (Cfg, error)

func (Cfg) DebugLog

func (c Cfg) DebugLog() log.LogLocation

func (Cfg) ErrorLog

func (c Cfg) ErrorLog() log.LogLocation

func (Cfg) EventLog

func (c Cfg) EventLog() log.LogLocation

func (Cfg) InfoLog

func (c Cfg) InfoLog() log.LogLocation

func (Cfg) WarningLog

func (c Cfg) WarningLog() log.LogLocation

type Duration

type Duration time.Duration

Duration is a JSON config time.Duration, which is marshalled and unmarshalled as milliseconds. Therefore, JSON keys of this type should be suffixed with '_ms'.

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type LogLocations

type LogLocations struct {
	LogLocationErr   string `json:"log_location_error"`
	LogLocationWarn  string `json:"log_location_warning"`
	LogLocationInfo  string `json:"log_location_info"`
	LogLocationDebug string `json:"log_location_debug"`
	LogLocationEvent string `json:"log_location_event"`
}

type URL

type URL url.URL

func (URL) MarshalJSON

func (u URL) MarshalJSON() ([]byte, error)

func (*URL) UnmarshalJSON

func (u *URL) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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