Documentation ¶
Index ¶
- Variables
- func DuplicateMap(m map[string]interface{}) map[string]interface{}
- func IsInterfaceNil(v interface{}) bool
- func ParseCLI(prefix string, args []string, out interface{}) error
- func Pipeliner(it PipelinerGenerator, nParallel int, proc PipelinerMapper) (PipelinerGenerator, PipelinerClose, error)
- func StandardInt(v interface{}) (uint64, bool)
- func UnmarshalCleanJSON(data string) (map[string]interface{}, error)
- type BoolExtractor
- type Dict
- func (d Dict) Duplicate() Dict
- func (d Dict) FindBool(path string) []bool
- func (d Dict) FindDict(path string) []Dict
- func (d Dict) FindInt(path string) []uint64
- func (d Dict) FindList(path string) []List
- func (d Dict) FindOneBool(path string) bool
- func (d Dict) FindOneDict(path string) Dict
- func (d Dict) FindOneInt(path string) uint64
- func (d Dict) FindOneList(path string) List
- func (d Dict) FindOneOpaque(path string) interface{}
- func (d Dict) FindOneString(path string) string
- func (d Dict) FindOpaque(path string) []interface{}
- func (d Dict) FindString(path string) []string
- func (d Dict) GetBool(k string) (bool, bool)
- func (d Dict) GetBuffer(k string) ([]byte, bool)
- func (d Dict) GetDict(k string) (Dict, bool)
- func (d Dict) GetInt(k string) (uint64, bool)
- func (d Dict) GetList(k string) (List, bool)
- func (d Dict) GetListOfDict(k string) ([]Dict, bool)
- func (d Dict) GetListOfString(k string) ([]string, bool)
- func (d Dict) GetString(k string) (string, bool)
- func (d Dict) ImportFromStruct(in interface{}) (Dict, error)
- func (d Dict) Keys() []string
- func (d Dict) UnMarshalToStruct(out interface{}) error
- func (d *Dict) UnmarshalJSON(data []byte) error
- func (d Dict) Values() []interface{}
- type DictExtractor
- type Element
- type Event
- type IntExtractor
- type List
- type ListExtractor
- type OpaqueExtractor
- type PipelinerClose
- type PipelinerGenerator
- type PipelinerMapper
- type PresenceExtractor
- type StreamTokenizer
- type StringExtractor
Constants ¶
This section is empty.
Variables ¶
var ErrorTooLarge = errors.New("too large")
Functions ¶
func DuplicateMap ¶
func IsInterfaceNil ¶
func IsInterfaceNil(v interface{}) bool
func ParseCLI ¶
Parses a list of tokens (like from a CLI) into a struct, using json.Unmarshal. Simplifies the population of configuration structs via CLI of a container without a custom container.
func Pipeliner ¶
func Pipeliner(it PipelinerGenerator, nParallel int, proc PipelinerMapper) (PipelinerGenerator, PipelinerClose, error)
The Pipeliner will consume elements from `it()` and process them with `proc()` in parallel (`nParallel` at a time). The returned generator will receive the processed elements _in the order they were generated_. The closer terminates all the pipeline (blocking). If the `it()` returns a `nil` element, it signifies the termination of the pipeline and the generator will produce a `nil` element.
func StandardInt ¶
func UnmarshalCleanJSON ¶
Types ¶
type BoolExtractor ¶
Generator for closures getting a bool at a specific path within a JSON object, if present.
func MakeExtractorForBool ¶
func MakeExtractorForBool(path string) BoolExtractor
type Dict ¶
type Dict map[string]interface{}
func (Dict) FindOneBool ¶
func (Dict) FindOneDict ¶
func (Dict) FindOneInt ¶
func (Dict) FindOneList ¶
func (Dict) FindOneOpaque ¶
func (Dict) FindOneString ¶
func (Dict) FindOpaque ¶
func (Dict) FindString ¶
func (Dict) ImportFromStruct ¶
func (Dict) UnMarshalToStruct ¶
func (*Dict) UnmarshalJSON ¶
type DictExtractor ¶
Generator for closures getting a Dict at a specific path within a JSON object, if present.
func MakeExtractorForDict ¶
func MakeExtractorForDict(path string) DictExtractor
type IntExtractor ¶
Generator for closures getting an int at a specific path within a JSON object, if present.
func MakeExtractorForInt ¶
func MakeExtractorForInt(path string) IntExtractor
type ListExtractor ¶
Generator for closures getting a Dict at a specific path within a JSON object, if present.
func MakeExtractorForList ¶
func MakeExtractorForList(path string) ListExtractor
type OpaqueExtractor ¶
type OpaqueExtractor func(evt Dict) []interface{}
Generator for closures getting an element at a specific path within a JSON object, if present.
func MakeExtractorForOpaque ¶
func MakeExtractorForOpaque(path string) OpaqueExtractor
type PipelinerClose ¶
type PipelinerClose = func()
type PipelinerGenerator ¶
type PipelinerMapper ¶
type PresenceExtractor ¶
func MakeExtractorForPresence ¶
func MakeExtractorForPresence(path string) PresenceExtractor
type StreamTokenizer ¶
type StringExtractor ¶
Generator for closures getting a string at a specific path within a JSON object, if present.
func MakeExtractorForString ¶
func MakeExtractorForString(path string) StringExtractor