Documentation ¶
Index ¶
- Variables
- func Load(filePath string, out WithDefaults, resolveEnv bool) (hash string, err error)
- func RecursivelyTurnYAMLMaps(in interface{}) interface{}
- type App
- type Component
- type Components
- type Config
- type Env
- type Input
- type Inputs
- type Node
- type Output
- type Outputs
- type Pipeline
- type Pipelines
- type Processor
- type Processors
- type WithDefaults
Constants ¶
This section is empty.
Variables ¶
var ( // EnvPrismConfigDir is Environment Variable that points to the configuration directory (default: ./config) EnvPrismConfigDir = Env{ // contains filtered or unexported fields } // EnvPrismDataDir is Environment Variable that points to the configuration directory (default: ./config) EnvPrismDataDir = Env{ // contains filtered or unexported fields } // EnvPrism is Environment Variable that represents either prod or dev environment EnvPrism = Env{ // contains filtered or unexported fields } )
var DefaultAppConfig = App{
Logger: "prod",
}
DefaultAppConfig used in defaults
var DefaultComponent = Component{ Concurrency: runtime.NumCPU(), }
DefaultComponent used in defaults
var DefaultInput = Input{ Component: DefaultComponent, }
DefaultInput used in defaults
var DefaultNode = Node{ Async: false, }
DefaultNode used in defaults
var DefaultOutput = Output{ Component: DefaultComponent, }
DefaultOutput used in defaults
var DefaultPipeline = Pipeline{ Concurrency: runtime.NumCPU(), }
DefaultPipeline used in defaults
var DefaultProcessor = Processor{ Component: DefaultComponent, }
DefaultProcessor used in defaults
Functions ¶
func Load ¶
func Load(filePath string, out WithDefaults, resolveEnv bool) (hash string, err error)
Load loads a .yaml file into out. resolveEnv will replace ${ENV_VAR} with value of env variable "ENV_VAR"
func RecursivelyTurnYAMLMaps ¶
func RecursivelyTurnYAMLMaps(in interface{}) interface{}
RecursivelyTurnYAMLMaps turns nested YAML maps from map[interface{}]interface{} to map[string]interface{} inspired by solutions in https://github.com/go-yaml/yaml/issues/139 especially elastic's #issuecomment-183937598
Types ¶
type Component ¶
type Component struct { Plugin string `yaml:"plugin"` Concurrency int `yaml:"concurrency"` Config map[string]interface{} `yaml:"config"` }
Component used for YAML decoding
type Components ¶
type Components struct { Inputs Inputs Processors Processors Outputs Outputs }
type Config ¶
type Config struct { App App Components Components Pipelines Pipelines Logger zap.SugaredLogger }
Config is the collection of config needed for the engine to start.
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env An Environment Variable Config
type Input ¶
type Input struct {
Component `yaml:",inline" mapstructure:",squash"`
}
Input used for YAML decoding
func (*Input) ApplyDefault ¶
ApplyDefault func used in defaults
type Inputs ¶
inputs used for YAML decoding
func (*Inputs) ApplyDefault ¶
ApplyDefault func used in defaults
type Output ¶
type Output struct {
Component `yaml:",inline" mapstructure:",squash"`
}
Output used for YAML decoding
func (*Output) ApplyDefault ¶
ApplyDefault func used in defaults
type Outputs ¶
outputs used for YAML decoding
func (*Outputs) ApplyDefault ¶
ApplyDefault func used in defaults
type Pipeline ¶
type Pipeline struct { Concurrency int `yaml:"concurrency"` Pipeline map[string]*Node `yaml:"pipeline"` }
Pipelines used for YAML decoding
func (*Pipeline) ApplyDefault ¶
ApplyDefault func used in defaults
type Pipelines ¶
Pipelines used for YAML decoding
func (*Pipelines) ApplyDefault ¶
ApplyDefault func used in defaults
type Processor ¶
type Processor struct {
Component `yaml:",inline" mapstructure:",squash"`
}
Processor used for YAML decoding
func (*Processor) ApplyDefault ¶
ApplyDefault func used in defaults
type Processors ¶
Processors used for YAML decoding
func (*Processors) ApplyDefault ¶
func (i *Processors) ApplyDefault() error
ApplyDefault func used in defaults
type WithDefaults ¶
type WithDefaults interface {
ApplyDefault() error
}
WithDefaults interface is the interface for default values