conf

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package conf provides access and convert data from configuration file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDefault

func AddDefault(log zerolog.Logger, c *ctx.Ctx, defaultConf *ctx.DefaultParams) bool

AddDefault adds predicate default parameters to context

func GetParams

func GetParams(ctx *ctx.Ctx, config interface{}, params interface{}) bool

GetParams from a map & evaluate Gval expressions in it

func GetPredicateParams

func GetPredicateParams(ctx *ctx.Ctx, config *Params, params interface{}) bool

GetPredicateParams from default and from the conf, with Gval expressions evaluated

func Read

func Read(r io.Reader) *yaml.Node

Read reads the reader as YAML and return Root config

func ReadFile added in v0.0.4

func ReadFile(filename string) *yaml.Node

ReadFile reads the YAML config file and returns document as a yaml.Node

Types

type Params

type Params struct {
	Name string
	Conf map[string]interface{}
}

Params contains name of predicate and its parameters as set in conf file

type Pipe

type Pipe struct {
	Name string
	Pipe []Predicate
}

Pipe maps a pipe in conf file

type Predicate

type Predicate map[string]yaml.Node

Predicate maps a predicate in conf file

type Root

type Root []Predicate

Root maps the main conf file

func ReadConfFile added in v0.0.5

func ReadConfFile(filename string) Root

ReadConfFile reads the YAML config file and returns Root config

Jump to

Keyboard shortcuts

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