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 ¶
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
func (*Authorization) Validate ¶ added in v0.40.0
func (a *Authorization) Validate() error
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.
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"`
ProxyConfig *ProxyConfig `river:",squash"`
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 ¶
func (h *HTTPClientConfig) Convert() *config.HTTPClientConfig
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 Header ¶ added in v0.40.0
type Header struct {
Header map[string][]rivertypes.Secret `river:"proxy_connect_header,attr,optional"`
}
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"`
ProxyConfig *ProxyConfig `river:",squash"`
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
func (*OAuth2Config) Validate ¶ added in v0.40.0
func (o *OAuth2Config) Validate() error
type ProxyConfig ¶ added in v0.40.0
type ProxyConfig struct {
ProxyURL URL `river:"proxy_url,attr,optional"`
NoProxy string `river:"no_proxy,attr,optional"`
ProxyFromEnvironment bool `river:"proxy_from_environment,attr,optional"`
ProxyConnectHeader Header `river:",squash"`
}
func (*ProxyConfig) Convert ¶ added in v0.40.0
func (p *ProxyConfig) Convert() config.ProxyConfig
func (*ProxyConfig) Validate ¶ added in v0.40.0
func (p *ProxyConfig) Validate() error
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.
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 ¶
URL mirrors config.URL
func (URL) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*URL) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler