config

package
v0.0.0-...-c89b607 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateSinkManagerConfig

func UpdateSinkManagerConfig(manager *sink.SinkManager, conf []SinkSourceConfig)

func UpdateSourceManagerConfig

func UpdateSourceManagerConfig(manager *source.SourceManager, conf []SinkSourceConfig)

func ValidateSinkConfigs

func ValidateSinkConfigs(conf []SinkSourceConfig) error

func ValidateSourceConfigs

func ValidateSourceConfigs(conf []SinkSourceConfig) error

Types

type Config

type Config struct {
	QueueSize     int                `yaml:"queue-size" validate:"required"`
	SinkQueueSize int                `yaml:"sink-queue-size" validate:"required"`
	LogLevel      string             `yaml:"log-level"` // TODO: build validator
	LogFormat     string             `yaml:"log-format" validate:"in:console,json"`
	Interface     string             `yaml:"interface" validate:"required|ip"`
	Port          int                `yaml:"port" validate:"required"`
	Sources       []SinkSourceConfig `yaml:"sources"`
	Sinks         []SinkSourceConfig `yaml:"sinks"`
}

func LoadConfig

func LoadConfig(configFile string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type SinkSourceConfig

type SinkSourceConfig struct {
	Name   string    `yaml:"name"`
	Type   string    `yaml:"type"`
	Config yaml.Node `yaml:"config"`
}

todo: find a better way than passing yaml.Node around

Jump to

Keyboard shortcuts

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