jsonfilter

package
v2.40.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *logger.Logger

Functions

func FilterPropertyByWildcard

func FilterPropertyByWildcard(jsonValue string, prefix string, patterns []string, setAlias bool) (map[string]interface{}, []string, error)

FilterPropertyByWildcard filtery a json string by using globstar (wildcards) on the nested json paths

Types

type JSONFilter

type JSONFilter struct {
	Property  string
	Operation string
	Value     interface{}
}

type JSONFilters

type JSONFilters struct {
	Logger             *logger.Logger
	Filters            []JSONFilter
	Selectors          []string
	Pluck              []string
	Flatten            bool
	AsCSV              bool
	AsTSV              bool
	AsCompletionFormat bool
}

func NewJSONFilters

func NewJSONFilters(l *logger.Logger) *JSONFilters

NewJSONFilters create a json filter

func (*JSONFilters) Add

func (f *JSONFilters) Add(property, operation string, value interface{})

func (*JSONFilters) AddRawFilters

func (f *JSONFilters) AddRawFilters(rawFilters []string) error

AddRawFilters add list of raw filters

func (*JSONFilters) AddSelectors

func (f *JSONFilters) AddSelectors(props ...string)

func (JSONFilters) Apply

func (f JSONFilters) Apply(jsonValue string, property string, showHeaders bool, setHeaderFunc func(string)) ([]byte, error)

Jump to

Keyboard shortcuts

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