config

package
v0.35.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config contains types from github.com/prometheus/common/config, but modifies them to be serializable with River.

Index

Constants

This section is empty.

Variables

View Source
var DefaultHTTPClientConfig = HTTPClientConfig{
	FollowRedirects: true,
	EnableHTTP2:     true,
}

DefaultHTTPClientConfig for initializing objects

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	Type            string            `river:"type,attr,optional"`
	Credentials     rivertypes.Secret `river:"credentials,attr,optional"`
	CredentialsFile string            `river:"credentials_file,attr,optional"`
}

Authorization sets up HTTP authorization credentials.

func (*Authorization) Convert

func (a *Authorization) Convert() *config.Authorization

Convert converts our type to the native prometheus type

type BasicAuth

type BasicAuth struct {
	Username     string            `river:"username,attr,optional"`
	Password     rivertypes.Secret `river:"password,attr,optional"`
	PasswordFile string            `river:"password_file,attr,optional"`
}

BasicAuth configures Basic HTTP authentication credentials.

func (*BasicAuth) Convert

func (b *BasicAuth) Convert() *config.BasicAuth

Convert converts our type to the native prometheus type

type HTTPClientConfig

type HTTPClientConfig struct {
	BasicAuth       *BasicAuth        `river:"basic_auth,block,optional"`
	Authorization   *Authorization    `river:"authorization,block,optional"`
	OAuth2          *OAuth2Config     `river:"oauth2,block,optional"`
	BearerToken     rivertypes.Secret `river:"bearer_token,attr,optional"`
	BearerTokenFile string            `river:"bearer_token_file,attr,optional"`
	ProxyURL        URL               `river:"proxy_url,attr,optional"`
	TLSConfig       TLSConfig         `river:"tls_config,block,optional"`
	FollowRedirects bool              `river:"follow_redirects,attr,optional"`
	EnableHTTP2     bool              `river:"enable_http2,attr,optional"`
}

HTTPClientConfig mirrors config.HTTPClientConfig

func CloneDefaultHTTPClientConfig added in v0.32.0

func CloneDefaultHTTPClientConfig() *HTTPClientConfig

Clone creates a shallow clone of h.

func (*HTTPClientConfig) Convert

Convert converts HTTPClientConfig to the native Prometheus type. If h is nil, the default client config is returned.

func (*HTTPClientConfig) SetToDefault added in v0.35.0

func (h *HTTPClientConfig) SetToDefault()

SetToDefault implements the river.Defaulter

func (*HTTPClientConfig) Validate added in v0.28.0

func (h *HTTPClientConfig) Validate() error

Validate returns an error if h is invalid.

type LabelSelector added in v0.33.0

type LabelSelector struct {
	MatchLabels      map[string]string `river:"match_labels,attr,optional"`
	MatchExpressions []MatchExpression `river:"match_expression,block,optional"`
}

LabelSelector defines a selector to check to see if a set of Kubernetes labels matches a selector.

func (*LabelSelector) BuildSelector added in v0.33.0

func (ls *LabelSelector) BuildSelector() (labels.Selector, error)

BuildSelector builds a labels.Selector from a Flow LabelSelector.

type MatchExpression added in v0.33.0

type MatchExpression struct {
	Key      string   `river:"key,attr"`
	Operator string   `river:"operator,attr"`
	Values   []string `river:"values,attr,optional"`
}

MatchExpression defines an expression matcher to check to see if some key from a Kubernetes resource matches a selector.

type OAuth2Config

type OAuth2Config struct {
	ClientID         string            `river:"client_id,attr,optional"`
	ClientSecret     rivertypes.Secret `river:"client_secret,attr,optional"`
	ClientSecretFile string            `river:"client_secret_file,attr,optional"`
	Scopes           []string          `river:"scopes,attr,optional"`
	TokenURL         string            `river:"token_url,attr,optional"`
	EndpointParams   map[string]string `river:"endpoint_params,attr,optional"`
	ProxyURL         URL               `river:"proxy_url,attr,optional"`
	TLSConfig        *TLSConfig        `river:"tls_config,block,optional"`
}

OAuth2Config sets up the OAuth2 client.

func (*OAuth2Config) Convert

func (o *OAuth2Config) Convert() *config.OAuth2

Convert converts our type to the native prometheus type

type TLSConfig

type TLSConfig struct {
	CA                 string            `river:"ca_pem,attr,optional"`
	CAFile             string            `river:"ca_file,attr,optional"`
	Cert               string            `river:"cert_pem,attr,optional"`
	CertFile           string            `river:"cert_file,attr,optional"`
	Key                rivertypes.Secret `river:"key_pem,attr,optional"`
	KeyFile            string            `river:"key_file,attr,optional"`
	ServerName         string            `river:"server_name,attr,optional"`
	InsecureSkipVerify bool              `river:"insecure_skip_verify,attr,optional"`
	MinVersion         TLSVersion        `river:"min_version,attr,optional"`
}

TLSConfig sets up options for TLS connections.

func (*TLSConfig) Convert

func (t *TLSConfig) Convert() *config.TLSConfig

Convert converts our type to the native prometheus type

func (*TLSConfig) Validate added in v0.33.0

func (t *TLSConfig) Validate() error

Validate reports whether t is valid.

type TLSVersion

type TLSVersion uint16

TLSVersion mirrors config.TLSVersion

func (TLSVersion) MarshalText

func (tv TLSVersion) MarshalText() (text []byte, err error)

MarshalText implements encoding.TextMarshaler

func (*TLSVersion) UnmarshalText

func (tv *TLSVersion) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type URL

type URL struct {
	*url.URL
}

URL mirrors config.URL

func (URL) Convert

func (u URL) Convert() config.URL

Convert converts our type to the native prometheus type

func (URL) MarshalText

func (u URL) MarshalText() (text []byte, err error)

MarshalText implements encoding.TextMarshaler

func (*URL) UnmarshalText

func (u *URL) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler

Jump to

Keyboard shortcuts

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