config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 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",
			FailFast: false,
			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"  json:"log_level"`
	LogFormat string            `toml:"log_format" yaml:"log_format" json:"log_format"`
	LogFields map[string]string `toml:"log_fields" yaml:"log_fields" json:"log_fields"`
	HttpPort  string            `toml:"http_port"  yaml:"http_port"  json:"http_port"`
}

type Config

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

func ReadConfig

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

type Engine

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

type FileStorage

type FileStorage struct {
	Directory string `toml:"directory" yaml:"directory" json:"directory"`
	Extention string `toml:"extention" yaml:"extention" json:"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"`
	Consistency string `toml:"consistency" yaml:"consistency" json:"consistency"`
}

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) Reverse added in v1.1.0

func (p Plugin) Reverse() bool

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