adapters

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoInstance represents an error when an instance isn't available in the context
	ErrNoInstance = errors.New("couldn't get the opentelemetry-collector instance from the context")

	// ErrInvalidYAML represents an error in the format of the configuration file
	ErrInvalidYAML = errors.New("couldn't parse the opentelemetry-collector configuration to assemble a list of ports for the service")
)
View Source
var (
	// ErrNoReceivers indicates that there are no receivers in the configuration
	ErrNoReceivers = errors.New("no receivers available as part of the configuration")

	// ErrReceiversNotAMap indicates that the receivers property isn't a map of values
	ErrReceiversNotAMap = errors.New("receivers property in the configuration doesn't contain valid receivers")
)

Functions

func ConfigFromCtx

func ConfigFromCtx(ctx context.Context) (map[interface{}]interface{}, error)

ConfigFromCtx extracts a configuration map from the given context. If an instance isn't available in the context, ErrNoInstance is returned. If the .Spec.Config isn't a valid YAML, ErrInvalidYAML is returned.

func ConfigFromString

func ConfigFromString(configStr string) (map[interface{}]interface{}, error)

ConfigFromString extracts a configuration map from the given string. If the given string isn't a valid YAML, ErrInvalidYAML is returned.

func ConfigToReceiverPorts

func ConfigToReceiverPorts(ctx context.Context, config map[interface{}]interface{}) ([]corev1.ServicePort, error)

ConfigToReceiverPorts converts the incoming configuration object into a set of service ports required by the receivers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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