config

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Slash                   = "/"
	Http                    = "http"
	Https                   = Http + "s"
	DefaultHttpPort  uint64 = 80
	DefaultHttpsPort uint64 = 443
	NoPort           uint64 = 99999 // 0 is a valid (system) port, so need something > maxPort

)
View Source
const (
	Comma = ","
	Dot   = "."
)
View Source
const (
	Empty = rconsts.Empty
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterFilterParameters

type ClusterFilterParameters struct {
	Name        string         `yaml:"name"`
	Identifiers model.LabelSet `yaml:"identifiers,omitempty"`
}

type CollectionParameters

type CollectionParameters struct {
	Include       map[string]bool `yaml:"include,omitempty"`
	Interval      string          `yaml:"interval"`
	IntervalSize  uint64          `yaml:"interval_size"`
	History       uint64          `yaml:"history"`
	HistoryInt    int             `yaml:"-"`
	Offset        uint64          `yaml:"offset"`
	OffsetInt     int             `yaml:"-"`
	SampleRate    uint64          `yaml:"sample_rate"`
	SampleRateSt  string          `yaml:"-"`
	NodeGroupList string          `yaml:"node_group_list"`
}

type DensifyParameters

type DensifyParameters struct {
	UrlConfig   *UrlConfig         `yaml:"url"`
	Endpoint    string             `yaml:"endpoint"`
	RetryConfig *rconf.RetryConfig `yaml:"retry,omitempty"`
}

type ForwarderParameters

type ForwarderParameters struct {
	Densify *DensifyParameters `yaml:"densify"`
	Proxy   *ProxyParameters   `yaml:"proxy,omitempty"`
	Prefix  string             `yaml:"prefix,omitempty"`
}

type Parameters

type Parameters struct {
	Forwarder  *ForwarderParameters       `yaml:"forwarder"`
	Prometheus *PrometheusParameters      `yaml:"prometheus"`
	Collection *CollectionParameters      `yaml:"collection"`
	Clusters   []*ClusterFilterParameters `yaml:"clusters"`
	Debug      bool                       `yaml:"debug"`
}

func ReadConfig

func ReadConfig() (p *Parameters, err error)

type PrometheusParameters

type PrometheusParameters struct {
	UrlConfig   *UrlConfig         `yaml:"url"`
	BearerToken string             `yaml:"bearer_token,omitempty"`
	CaCertPath  string             `yaml:"ca_cert,omitempty"`
	SigV4Config *sigv4.SigV4Config `yaml:"sigv4,omitempty"`
	RetryConfig *rconf.RetryConfig `yaml:"retry,omitempty"`
}

type ProxyParameters

type ProxyParameters struct {
	UrlConfig *UrlConfig `yaml:"url"`
	Auth      string     `yaml:"auth,omitempty"`
	Server    string     `yaml:"server,omitempty"`
	Domain    string     `yaml:"domain,omitempty"`
}

type UrlConfig

type UrlConfig struct {
	Scheme            string `yaml:"scheme"`
	Host              string `yaml:"host"`
	Port              uint64 `yaml:"port"`
	Username          string `yaml:"username,omitempty"`
	Password          string `yaml:"password,omitempty"`
	EncryptedPassword string `yaml:"encrypted_password,omitempty"`
	Url               string `yaml:"-"`
}

type ValueOrPath

type ValueOrPath struct {
	// contains filtered or unexported fields
}

func NewValueOrPath

func NewValueOrPath(s string, fileOnly, shouldRead bool) (vop *ValueOrPath, e error)

func (*ValueOrPath) IsEmpty

func (vop *ValueOrPath) IsEmpty() bool

func (*ValueOrPath) IsFile

func (vop *ValueOrPath) IsFile() bool

func (*ValueOrPath) Path

func (vop *ValueOrPath) Path() string

func (*ValueOrPath) Value

func (vop *ValueOrPath) Value() string

Jump to

Keyboard shortcuts

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