config

package
v7.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPollStateJSONLog         = "/var/log/trafficcontrol/poll-state.json"
	DefaultConfigFile               = "/etc/trafficcontrol/tc-health-client.json"
	DefaultLogDirectory             = "/var/log/trafficcontrol"
	DefaultLogFile                  = "tc-health-client.log"
	DefaultTOLoginDispersionFactor  = 90
	DefaultTrafficServerConfigDir   = "/opt/trafficserver/etc/trafficserver"
	DefaultTrafficServerBinDir      = "/opt/trafficserver/bin"
	DefaultUnavailablePollThreshold = 2
	DefaultMarkupPollThreshold      = 1
)

Variables

This section is empty.

Functions

func GetRequestTimeout

func GetRequestTimeout() time.Duration

func GetTMPollingInterval

func GetTMPollingInterval() time.Duration

func GetTOLoginDispersion

func GetTOLoginDispersion(dispersionFactor int) time.Duration

func GetTrafficMonitors

func GetTrafficMonitors(cfg *Cfg) error

func LoadConfig

func LoadConfig(cfg *Cfg) (bool, error)

func ReadCredentials

func ReadCredentials(cfg *Cfg, updating bool) error

*

  • ReadCredentials *
  • cfg - the existing config
  • updating - when true, existing credentials may be updated from the credential file

func UpdateConfig

func UpdateConfig(cfg *Cfg, newCfg *Cfg)

func Usage

func Usage()

Types

type Cfg

type Cfg struct {
	CDNName                  string          `json:"cdn-name"`
	EnableActiveMarkdowns    bool            `json:"enable-active-markdowns"`
	ReasonCode               string          `json:"reason-code"`
	TOCredentialFile         string          `json:"to-credential-file"`
	TORequestTimeOutSeconds  string          `json:"to-request-timeout-seconds"`
	TOPass                   string          `json:"to-pass"`
	TOUrl                    string          `json:"to-url"`
	TOUser                   string          `json:"to-user"`
	TmProxyURL               string          `json:"tm-proxy-url"`
	TmPollIntervalSeconds    string          `json:"tm-poll-interval-seconds"`
	TOLoginDispersionFactor  int             `json:"to-login-dispersion-factor"`
	UnavailablePollThreshold int             `json:"unavailable-poll-threshold"`
	MarkUpPollThreshold      int             `json:"markup-poll-threshold"`
	TrafficServerConfigDir   string          `json:"trafficserver-config-dir"`
	TrafficServerBinDir      string          `json:"trafficserver-bin-dir"`
	PollStateJSONLog         string          `json:"poll-state-json-log"`
	EnablePollStateLog       bool            `json:"enable-poll-state-log"`
	TrafficMonitors          map[string]bool `json:"trafficmonitors,omitempty"`
	HealthClientConfigFile   util.ConfigFile
	CredentialFile           util.ConfigFile
	ParsedProxyURL           *url.URL
}

func GetConfig

func GetConfig() (Cfg, error, bool)

type LogCfg

type LogCfg struct {
	LogLocationErr   string
	LogLocationDebug string
	LogLocationInfo  string
	LogLocationWarn  string
}

func (LogCfg) DebugLog

func (lcfg LogCfg) DebugLog() log.LogLocation

func (LogCfg) ErrorLog

func (lcfg LogCfg) ErrorLog() log.LogLocation

func (LogCfg) EventLog

func (lcfg LogCfg) EventLog() log.LogLocation

func (LogCfg) InfoLog

func (lcfg LogCfg) InfoLog() log.LogLocation

func (LogCfg) WarningLog

func (lcfg LogCfg) WarningLog() log.LogLocation

Jump to

Keyboard shortcuts

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