adapters

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package adapters is for data conversion.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidYAML represents an error in the format of the configuration file.
	ErrInvalidYAML = errors.New("couldn't parse the yaml configuration")
	ErrInvalidJSON = errors.New("couldn't parse cloudwatch agent json configuration")
)
View Source
var (
	ErrNoServiceExtensions = errors.New("service property in the configuration doesn't contain extensions")

	ErrNoServiceExtensionHealthCheck = errors.New("no healthcheck extension available in service extension configuration")
)

Functions

func ConfigFromJSONString

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

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 ConfigToContainerProbe

func ConfigToContainerProbe(config map[interface{}]interface{}) (*corev1.Probe, error)

ConfigToContainerProbe converts the incoming configuration object into a container probe or returns an error.

func ConfigToMetricsPort

func ConfigToMetricsPort(logger logr.Logger, config map[interface{}]interface{}) (int32, error)

ConfigToMetricsPort gets the port number for the metrics endpoint from the collector config if it has been set.

Types

type ComponentType

type ComponentType int
const (
	ComponentTypeReceiver ComponentType = iota
	ComponentTypeExporter
)

func (ComponentType) String

func (c ComponentType) String() string

type CwaConfig

type CwaConfig struct {
	Metrics *metric `json:"metrics,omitempty"`
	Logs    *log    `json:"logs,omitempty"`
	Traces  *trace  `json:"traces,omitempty"`
}

func ConfigStructFromJSONString

func ConfigStructFromJSONString(configStr string) (*CwaConfig, error)

Jump to

Keyboard shortcuts

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