config

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LuaEngine       = "lua"
	LuaCustomEngine = "lua_custom"
	CELEngine       = "cel"
	ScriptEngine    = "script"
	L4Engine        = "l4"
)

Variables

This section is empty.

Functions

func GetConfigReader

func GetConfigReader(path string) (io.Reader, error)

Types

type Config

type Config struct {
	Version       string               `mapstructure:"version"`
	Validators    []*ValidatorConfig   `mapstructure:"validators"`
	InputMetrics  *InputMetricsConfig  `mapstructure:"input_metrics"`
	OutputMetrics *OutputMetricsConfig `mapstructure:"output_metrics"`
}

func GetConfig

func GetConfig(path string, executeTemplate bool, verbose bool) (*Config, error)

type InputMetricsConfig

type InputMetricsConfig struct {
	Format string                 `mapstructure:"format,omitempty"`
	Type   string                 `mapstructure:"type"`
	Src    string                 `mapstructure:"src"`
	Regexp string                 `mapstructure:"regexp"` // deprecated
	Extra  map[string]interface{} `mapstructure:"extra"`
}

type OutputMetricsConfig

type OutputMetricsConfig struct {
	Type  string                 `mapstructure:"type"`
	Dst   string                 `mapstructure:"dst"`
	Extra map[string]interface{} `mapstructure:"extra"`
}

type ValidatorConfig

type ValidatorConfig struct {
	Type        string                 `mapstructure:"type"`
	Rule        string                 `mapstructure:"rule"`
	Title       string                 `mapstructure:"title"`
	Description string                 `mapstructure:"description"`
	Name        string                 `mapstructure:"name"`
	Major       bool                   `mapstructure:"major"` // v3 and up
	Extra       map[string]interface{} `mapstructure:"extra"`
}

Jump to

Keyboard shortcuts

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