filter

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

* Copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter map[string]FilterTerm

func Parse

func Parse(spec string) (Filter, error)

Parse parses a comma separated list of filter terms

func (Filter) Evaluate

func (f Filter) Evaluate(item interface{}) (bool, error)

func (Filter) EvaluateTerm added in v1.1.5

func (f Filter) EvaluateTerm(k string, v FilterTerm, val reflect.Value, recurse bool) (bool, error)

func (Filter) Process

func (f Filter) Process(data interface{}) (interface{}, error)

type FilterTerm

type FilterTerm struct {
	Op    Operation
	Value string
	// contains filtered or unexported fields
}

type Operation

type Operation int
const (
	UK Operation = iota
	EQ
	NE
	GT
	LT
	GE
	LE
	RE
)

Jump to

Keyboard shortcuts

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