Documentation
¶
Overview ¶
Package config contains types from github.com/prometheus/common/config, but modifiys 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
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"`
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 (*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) UnmarshalRiver ¶
func (h *HTTPClientConfig) UnmarshalRiver(f func(v interface{}) error) error
UnmarshalRiver implements the umarshaller
func (*HTTPClientConfig) Validate ¶ added in v0.28.0
func (h *HTTPClientConfig) Validate() error
Validate returns an error if h is invalid.
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,attr,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 {
CAFile string `river:"ca_file,attr,optional"`
CertFile string `river:"cert_file,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