extractor

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor interface {
	ExtractLabels(logger log.Logger, json []byte, paths []string) ([]string, error)
	ExtractValue(logger log.Logger, json []byte, path string) (float64, error)
	ExtractObject(logger log.Logger, json []byte, path string) (ObjectIterator, error)
}

type JqExtractor

type JqExtractor struct {
}

func (*JqExtractor) ExtractLabels

func (e *JqExtractor) ExtractLabels(logger log.Logger, json []byte, paths []string) ([]string, error)

Returns the list of labels created from the list of provided json paths

func (*JqExtractor) ExtractObject

func (e *JqExtractor) ExtractObject(logger log.Logger, json []byte, path string) (ObjectIterator, error)

func (*JqExtractor) ExtractValue

func (e *JqExtractor) ExtractValue(logger log.Logger, json []byte, path string) (float64, error)

Returns the first matching float value at the given json path

type JsonPathExtractor

type JsonPathExtractor struct {
}

func (*JsonPathExtractor) ExtractLabels

func (e *JsonPathExtractor) ExtractLabels(logger log.Logger, json []byte, paths []string) ([]string, error)

Returns the list of labels created from the list of provided json paths

func (*JsonPathExtractor) ExtractObject

func (e *JsonPathExtractor) ExtractObject(logger log.Logger, json []byte, path string) (ObjectIterator, error)

func (*JsonPathExtractor) ExtractValue

func (e *JsonPathExtractor) ExtractValue(logger log.Logger, json []byte, path string) (float64, error)

Returns the first matching float value at the given json path

type ObjectIterator

type ObjectIterator func() (json []byte, exists bool, err error)

Jump to

Keyboard shortcuts

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