config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Default = Config{
		Common: Common{
			LogLevel:  "info",
			LogFormat: "logfmt",
			HttpPort:  ":9600",
		},
		Engine: Engine{
			Storage: "fs",
			File: FileStorage{
				Directory: ".pipelines",
				Extention: ".toml",
			},
		},
	}
)

Functions

func MarshalPipeline

func MarshalPipeline(pipe *Pipeline, format string) ([]byte, error)

Types

type Common

type Common struct {
	LogLevel  string            `toml:"log_level"  yaml:"log_level"`
	LogFormat string            `toml:"log_format" yaml:"log_format"`
	LogFields map[string]string `toml:"log_fields" yaml:"log_fields"`
	HttpPort  string            `toml:"http_port"  yaml:"http_port"`
}

type Config

type Config struct {
	Common Common `toml:"common" yaml:"common"`
	Engine Engine `toml:"engine" yaml:"engine"`
}

func ReadConfig

func ReadConfig(file string) (*Config, error)

type Engine

type Engine struct {
	Storage string      `toml:"storage" yaml:"storage"`
	File    FileStorage `toml:"fs"      yaml:"fs"`
}

type FileStorage

type FileStorage struct {
	Directory string `toml:"directory" yaml:"directory"`
	Extention string `toml:"extention" yaml:"extention"`
}

type PipeSettings

type PipeSettings struct {
	Id     string `toml:"id"     yaml:"id"     json:"id"`
	Lines  int    `toml:"lines"  yaml:"lines"  json:"lines"`
	Run    bool   `toml:"run"    yaml:"run"    json:"run"`
	Buffer int    `toml:"buffer" yaml:"buffer" json:"buffer"`
}

type Pipeline

type Pipeline struct {
	Settings   PipeSettings `toml:"settings"   yaml:"settings"   json:"settings"`
	Inputs     []PluginSet  `toml:"inputs"     yaml:"inputs"     json:"inputs"`
	Processors []PluginSet  `toml:"processors" yaml:"processors" json:"processors"`
	Outputs    []PluginSet  `toml:"outputs"    yaml:"outputs"    json:"outputs"`
	Keykeepers []PluginSet  `toml:"keykeepers" yaml:"keykeepers" json:"keykeepers"`
}

TODO: rewrite to structs

func UnmarshalPipeline

func UnmarshalPipeline(data []byte, format string) (*Pipeline, error)

type Plugin

type Plugin map[string]any

func (Plugin) Alias

func (p Plugin) Alias() string

func (Plugin) Filters

func (p Plugin) Filters() PluginSet

func (Plugin) Id

func (p Plugin) Id() uint64

func (Plugin) LogLevel

func (p Plugin) LogLevel() string

func (Plugin) Parser

func (p Plugin) Parser() Plugin

func (Plugin) Serializer

func (p Plugin) Serializer() Plugin

func (Plugin) Type

func (p Plugin) Type() string

type PluginSet

type PluginSet map[string]Plugin

Jump to

Keyboard shortcuts

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