config

package
v1.6.11 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 15 Imported by: 127

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalIP added in v1.0.6

func LocalIP() (net.IP, error)

LocalIP tries to determine a non-loopback address for the local machine

func LocalIPString added in v1.0.6

func LocalIPString() string

Types

type AuthScheme added in v1.5.11

type AuthScheme struct {
	Name  string
	Type  string
	Basic BasicAuth
}

type BGP added in v1.6.3

type BGP struct {
	RouterID          string
	GRPCListenAddress string
	CertFile          string
	KeyFile           string
	GOBGPDCfgFile     string
	NextHop           string
	AnycastAddresses  []string
	ListenAddresses   []string
	Peers             []BGPPeer
	Asn               uint
	ListenPort        int
	BGPEnabled        bool
	EnableGRPC        bool
	GRPCTLS           bool
}

type BGPPeer added in v1.6.3

type BGPPeer struct {
	NeighborAddress string
	Password        string
	NeighborPort    uint
	Asn             uint
	MultiHopLength  uint
	MultiHop        bool
}

type BasicAuth added in v1.5.11

type BasicAuth struct {
	ModTime time.Time // the htpasswd file last modification time
	Realm   string
	File    string
	Refresh time.Duration
}

type CertSource added in v1.2.1

type CertSource struct {
	Header          http.Header
	Name            string
	Type            string
	CertPath        string
	KeyPath         string
	ClientCAPath    string
	CAUpgradeCN     string
	VaultFetchToken string
	Refresh         time.Duration
}

type Circonus added in v1.3.6

type Circonus struct {
	APIKey        string
	APIApp        string
	APIURL        string
	CheckID       string
	BrokerID      string
	SubmissionURL string
}

type Config

type Config struct {
	Log                  Log
	ProfileMode          string
	ProfilePath          string
	Tracing              Tracing
	Listen               []Listen
	Metrics              Metrics
	BGP                  BGP
	UI                   UI
	Registry             Registry
	Proxy                Proxy
	Runtime              Runtime
	GlobCacheSize        int
	Insecure             bool
	GlobMatchingDisabled bool
}

func Load added in v1.1.1

func Load(args, environ []string) (cfg *Config, err error)

type Consul

type Consul struct {
	Addr               string
	Scheme             string
	Token              string
	KVPath             string
	NoRouteHTMLPath    string
	TagPrefix          string
	Namespace          string
	ServiceAddr        string
	ServiceName        string
	CheckScheme        string
	ChecksRequired     string
	TLS                ConsulTlS
	ServiceTags        []string
	ServiceStatus      []string
	CheckInterval      time.Duration
	CheckTimeout       time.Duration
	ServiceMonitors    int
	PollInterval       time.Duration
	Register           bool
	CheckTLSSkipVerify bool
	RequireConsistent  bool
	AllowStale         bool
}

type ConsulTlS added in v1.5.14

type ConsulTlS struct {
	KeyFile            string
	CertFile           string
	CAFile             string
	CAPath             string
	InsecureSkipVerify bool
}

type Custom added in v1.5.14

type Custom struct {
	Host               string
	Path               string
	QueryParams        string
	Scheme             string
	NoRouteHTML        string
	PollInterval       time.Duration
	Timeout            time.Duration
	CheckTLSSkipVerify bool
}

type File added in v1.1.1

type File struct {
	NoRouteHTMLPath string
	RoutesPath      string
}

type FlagSet added in v1.2.1

type FlagSet struct {
	flag.FlagSet
	// contains filtered or unexported fields
}

-- FlagSet

func NewFlagSet added in v1.2.1

func NewFlagSet(name string, errorHandling flag.ErrorHandling) *FlagSet

func (*FlagSet) FloatSliceVar added in v1.6.0

func (f *FlagSet) FloatSliceVar(p *[]float64, name string, value []float64, usage string)

func (*FlagSet) IsSet added in v1.2.1

func (f *FlagSet) IsSet(name string) bool

IsSet returns true if a variable was set via any mechanism.

func (*FlagSet) ParseFlags added in v1.2.1

func (f *FlagSet) ParseFlags(args, environ, prefixes []string, p *properties.Properties) error

ParseFlags parses command line arguments and provides fallback values from environment variables and config file values. Environment variables are case-insensitive and can have either of the provided prefixes.

func (*FlagSet) StringSliceVar added in v1.2.1

func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string)

type Listen

type Listen struct {
	CertSource         CertSource
	Addr               string
	Proto              string
	TLSCiphers         []uint16
	ReadTimeout        time.Duration
	WriteTimeout       time.Duration
	IdleTimeout        time.Duration
	ProxyHeaderTimeout time.Duration
	Refresh            time.Duration
	TLSMinVersion      uint16
	TLSMaxVersion      uint16
	StrictMatch        bool
	ProxyProto         bool
}

type Log added in v1.4.1

type Log struct {
	AccessFormat string
	AccessTarget string
	RoutesFormat string
	Level        string
}

type Metrics

type Metrics struct {
	Circonus      Circonus
	Target        string
	Prefix        string
	Names         string
	GraphiteAddr  string
	StatsDAddr    string
	DogstatsdAddr string
	Prometheus    Prometheus
	Interval      time.Duration
	Timeout       time.Duration
	Retry         time.Duration
}

type Prometheus added in v1.6.0

type Prometheus struct {
	Subsystem string
	Path      string
	Buckets   []float64
}

type Proxy

type Proxy struct {
	GZIPContentTypes      *regexp.Regexp
	AuthSchemes           map[string]AuthScheme
	Strategy              string
	Matcher               string
	LocalIP               string
	ClientIPHeader        string
	TLSHeader             string
	TLSHeaderValue        string
	RequestID             string
	STSHeader             STSHeader
	NoRouteStatus         int
	MaxConn               int
	ShutdownWait          time.Duration
	DeregisterGracePeriod time.Duration
	DialTimeout           time.Duration
	ResponseHeaderTimeout time.Duration
	KeepAliveTimeout      time.Duration
	IdleConnTimeout       time.Duration
	FlushInterval         time.Duration
	GlobalFlushInterval   time.Duration
	GRPCMaxRxMsgSize      int
	GRPCMaxTxMsgSize      int
	GRPCGShutdownTimeout  time.Duration
}

type Registry added in v1.1.1

type Registry struct {
	Static  Static
	File    File
	Backend string
	Custom  Custom
	Consul  Consul
	Timeout time.Duration
	Retry   time.Duration
}

type RoutingTable added in v1.6.3

type RoutingTable struct {
	Source Source
}

type Runtime

type Runtime struct {
	GOGC       int
	GOMAXPROCS int
}

type STSHeader added in v1.5.11

type STSHeader struct {
	MaxAge     int
	Subdomains bool
	Preload    bool
}

type Source added in v1.6.3

type Source struct {
	Scheme      string
	Host        string
	Port        string
	LinkEnabled bool
	NewTab      bool
}

type Static added in v1.1.1

type Static struct {
	NoRouteHTML string
	Routes      string
}

type Tracing added in v1.5.11

type Tracing struct {
	CollectorType  string
	ConnectString  string
	ServiceName    string
	Topic          string
	SpanHost       string
	SpanName       string
	SamplerRate    float64
	TracingEnabled bool
	TraceID128Bit  bool
}

type UI

type UI struct {
	RoutingTable RoutingTable
	Color        string
	Title        string
	Access       string
	Listen       Listen
}

Jump to

Keyboard shortcuts

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