config

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config contains the operator's runtime configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Registers a callback, to be called once a configuration change happens
	OnChange func() error
	// contains filtered or unexported fields
}

Config holds the static configuration for this operator

func New

func New(opts ...Option) Config

New constructs a new configuration based on the given options

func (*Config) AutoDetect

func (c *Config) AutoDetect() error

AutoDetect attempts to automatically detect relevant information for this operator.

func (*Config) CollectorConfigMapEntry

func (c *Config) CollectorConfigMapEntry() string

CollectorConfigMapEntry represents the configuration file name for the collector. Immutable.

func (*Config) CollectorImage

func (c *Config) CollectorImage() string

CollectorImage represents the flag to override the OpenTelemetry Collector container image.

func (*Config) FlagSet

func (c *Config) FlagSet() *pflag.FlagSet

FlagSet binds the flags to the user-modifiable values of the operator's configuration

func (*Config) Platform

func (c *Config) Platform() platform.Platform

Platform represents the type of the platform this operator is running

func (*Config) StartAutoDetect

func (c *Config) StartAutoDetect() error

StartAutoDetect attempts to automatically detect relevant information for this operator. This will block until the first run is executed and will schedule periodic updates.

func (*Config) Version

func (c *Config) Version() version.Version

Version holds the versions used by this operator

type Option

type Option func(c *options)

Option represents one specific configuration option

func WithAutoDetect

func WithAutoDetect(a autodetect.AutoDetect) Option

func WithAutoDetectFrequency

func WithAutoDetectFrequency(t time.Duration) Option

func WithCollectorConfigMapEntry

func WithCollectorConfigMapEntry(s string) Option

func WithCollectorImage

func WithCollectorImage(s string) Option

func WithLogger

func WithLogger(logger logr.Logger) Option

func WithOnChange

func WithOnChange(f func() error) Option

func WithPlatform

func WithPlatform(plt platform.Platform) Option

func WithVersion

func WithVersion(v version.Version) Option

Jump to

Keyboard shortcuts

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