Documentation
¶
Index ¶
- Variables
- func MergeKeyGroups(rows [][]KeyGroup) []string
- type HeaderFunc
- type JSONFilter
- type JSONFilters
- func (f *JSONFilters) Add(property, operation string, value interface{})
- func (f *JSONFilters) AddRawFilters(rawFilters []string) error
- func (f *JSONFilters) AddSelectors(props ...string)
- func (f JSONFilters) Apply(jsonValue string, property string, showHeaders bool, setHeaderFunc HeaderFunc) ([]byte, error)
- type KeyGroup
Constants ¶
This section is empty.
Variables ¶
var Logger *logger.Logger
Functions ¶
func MergeKeyGroups ¶ added in v2.55.0
MergeKeyGroups merges the resolved keys of multiple sampled rows into a single ordered column list. Columns are ordered by select pattern, and each pattern expands to the union of the keys it resolved to across all rows (deduplicated case insensitively). Patterns which did not resolve against any row are included as-is so the user can still see which selector returned nothing
Types ¶
type HeaderFunc ¶ added in v2.55.0
HeaderFunc callback which receives the resolved keys of a single row. keys is the flat comma separated list (unmatched patterns are included as-is), and groups contains the keys grouped by the select pattern which resolved them
type JSONFilter ¶
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 HeaderFunc) ([]byte, error)
type KeyGroup ¶ added in v2.55.0
type KeyGroup struct {
// Pattern original (non-lowercased) select pattern
Pattern string
// Keys resolved json keys (empty if the pattern did not match)
Keys []string
}
KeyGroup records which concrete json keys a single select pattern resolved to within one row. Keys is empty when the pattern did not match anything in the row