package envconfig
import "go.opentelemetry.io/otel/exporters/otlp/internal/envconfig"
Index ¶
- func WithDuration(n string, fn func(time.Duration)) func(e *EnvOptionsReader)
- func WithHeaders(n string, fn func(map[string]string)) func(e *EnvOptionsReader)
- func WithString(n string, fn func(string)) func(e *EnvOptionsReader)
- func WithTLSConfig(n string, fn func(*tls.Config)) func(e *EnvOptionsReader)
- func WithURL(n string, fn func(*url.URL)) func(e *EnvOptionsReader)
- type ConfigFn
- type EnvOptionsReader
Functions ¶
func WithDuration ¶
func WithDuration(n string, fn func(time.Duration)) func(e *EnvOptionsReader)
WithDuration retrieves the specified config and passes it to ConfigFn as a duration
func WithHeaders ¶
func WithHeaders(n string, fn func(map[string]string)) func(e *EnvOptionsReader)
WithHeaders retrieves the specified config and passes it to ConfigFn as a map of HTTP headers
func WithString ¶
func WithString(n string, fn func(string)) func(e *EnvOptionsReader)
WithString retrieves the specified config and passes it to ConfigFn as a string
func WithTLSConfig ¶
func WithTLSConfig(n string, fn func(*tls.Config)) func(e *EnvOptionsReader)
WithTLSConfig retrieves the specified config and passes it to ConfigFn as a crypto/tls.Config
func WithURL ¶
func WithURL(n string, fn func(*url.URL)) func(e *EnvOptionsReader)
WithURL retrieves the specified config and passes it to ConfigFn as a net/url.URL
Types ¶
type ConfigFn ¶
type ConfigFn func(*EnvOptionsReader)
ConfigFn is the generic function used to set a config
type EnvOptionsReader ¶
type EnvOptionsReader struct { GetEnv func(string) string ReadFile func(string) ([]byte, error) Namespace string }
EnvOptionsReader reads the required environment variables
func (*EnvOptionsReader) Apply ¶
func (e *EnvOptionsReader) Apply(opts ...ConfigFn)
Apply runs every ConfigFn
func (*EnvOptionsReader) GetEnvValue ¶
func (e *EnvOptionsReader) GetEnvValue(key string) (string, bool)
GetEnvValue gets an OTLP environment variable value of the specified key using the GetEnv function. This function prepends the OTLP specified namespace to all key lookups.
Source Files ¶
envconfig.go
- Version
- v1.6.1
- Published
- Mar 28, 2022
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 37 seconds ago –
Tools for package owners.