config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Subsystem = "config"

Variables

This section is empty.

Functions

This section is empty.

Types

type ArangoOutputConfig

type ArangoOutputConfig struct {
	BaseOutputConfig
	URL                 string `koanf:"url" validate:"required,url"`
	DB                  string `koanf:"database" validate:"required"`
	Username            string `koanf:"username" validate:"required"`
	Password            string `koanf:"password" validate:"required"`
	SkipTlsVerification bool   `koanf:"skip_tls_verification"`
}

type BaseInputConfig

type BaseInputConfig struct {
	Name string `koanf:"name" validate:"required"`
}

func (BaseInputConfig) IsInput

func (BaseInputConfig) IsInput()

type BaseOutputConfig

type BaseOutputConfig struct {
	Name string `koanf:"name" validate:"required"`
}

func (BaseOutputConfig) IsOutput

func (BaseOutputConfig) IsOutput()

type BaseProcessorConfig

type BaseProcessorConfig struct {
	Name string `koanf:"name" validate:"required"`
}

type Config

type Config interface {
	Read() error
	Validate() error
	GetInputs() map[string]InputConfig
	GetOutputs() map[string]OutputConfig
	GetProcessors() map[string]ProcessorConfig
}

type DefaultConfig

type DefaultConfig struct {
	// contains filtered or unexported fields
}

func NewDefaultConfig

func NewDefaultConfig(configLocation string) *DefaultConfig

func (*DefaultConfig) GetInputs

func (config *DefaultConfig) GetInputs() map[string]InputConfig

func (*DefaultConfig) GetOutputs

func (config *DefaultConfig) GetOutputs() map[string]OutputConfig

func (*DefaultConfig) GetProcessors

func (config *DefaultConfig) GetProcessors() map[string]ProcessorConfig

func (*DefaultConfig) Read

func (config *DefaultConfig) Read() error

func (*DefaultConfig) Validate

func (config *DefaultConfig) Validate() error

type InfluxInputConfig

type InfluxInputConfig struct {
	BaseInputConfig
	URL      string `koanf:"url" validate:"required,url"`
	DB       string `koanf:"db" validate:"required"`
	Username string `koanf:"username" validate:"required"`
	Password string `koanf:"password" validate:"required"`
	Timeout  uint   `koanf:"timeout" validate:"required"`
}

type InputConfig

type InputConfig interface {
	IsInput()
}

type InputOption

type InputOption struct {
	Name           string          `koanf:"name" validate:"required"`
	Measurement    string          `koanf:"measurement" validate:"required"`
	Field          string          `koanf:"field" validate:"required"`
	Method         string          `koanf:"method" validate:"required"`
	GroupBy        []string        `koanf:"group_by" validate:"required"`
	Transformation *Transformation `koanf:"transformation"`
}

type KafkaInputConfig

type KafkaInputConfig struct {
	BaseInputConfig
	Broker string `koanf:"broker" validate:"required,hostname_port"`
	Topic  string `koanf:"topic" validate:"required"`
}

type KafkaOutputConfig

type KafkaOutputConfig struct {
	BaseOutputConfig
	Broker string `koanf:"broker" validate:"required,hostname_port"`
	Topic  string `koanf:"topic" validate:"required"`
	Type   string `koanf:"type" validate:"required"`
}

type Mode

type Mode struct {
	InputOptions  map[string]InputOption  `koanf:"input-options" validate:"required"`
	OutputOptions map[string]OutputOption `koanf:"output-options" validate:"required"`
}

type Normalization

type Normalization struct {
	FieldMappings map[string]string `koanf:"field-mappings" validate:"required"`
}

type OutputConfig

type OutputConfig interface {
	IsOutput()
}

type OutputOption

type OutputOption struct {
	Name       string   `koanf:"name" validate:"required"`
	Method     string   `koanf:"method" validate:"required"`
	Collection string   `koanf:"collection" validate:"required"`
	FilterBy   []string `koanf:"filter_by" validate:"required"`
	Field      string   `koanf:"field" validate:"required"`
}

type ProcessorConfig

type ProcessorConfig interface {
	// contains filtered or unexported methods
}

type TelemetryToArangoProcessorConfig

type TelemetryToArangoProcessorConfig struct {
	BaseProcessorConfig
	Inputs        []string      `koanf:"inputs" validate:"required"`
	Outputs       []string      `koanf:"outputs" validate:"required"`
	Interval      uint          `koanf:"interval" validate:"required,min=1"`
	Normalization Normalization `koanf:"normalization" validate:"required"`
	Modes         []Mode        `koanf:"modes" validate:"required"`
}

type Transformation

type Transformation struct {
	Operation string `koanf:"operation" validate:"required"`
	Period    uint   `koanf:"period" validate:"required"`
}

Jump to

Keyboard shortcuts

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