ops

package
v0.0.0-...-6244b48 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

The ops package provides a set of functions that can be used to build a filter AST programatically using basic functions, versus building a filter AST leveraging all structural components of the tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And(node, next ast.FilterNode, others ...ast.FilterNode) ast.FilterNode

func Contains

func Contains[T ~string](field T, value string) ast.FilterNode

func ContainsPrefix

func ContainsPrefix[T ~string](field T, value string) ast.FilterNode

func ContainsSuffix

func ContainsSuffix[T ~string](field T, value string) ast.FilterNode

func Eq

func Eq[T ~string](field T, value string) ast.FilterNode

func Not

func Not(node ast.FilterNode) ast.FilterNode

func NotContains

func NotContains[T ~string](field T, value string) ast.FilterNode

func NotContainsPrefix

func NotContainsPrefix[T ~string](field T, value string) ast.FilterNode

func NotContainsSuffix

func NotContainsSuffix[T ~string](field T, value string) ast.FilterNode

func NotEq

func NotEq[T ~string](field T, value string) ast.FilterNode

func Or

func Or(node, next ast.FilterNode, others ...ast.FilterNode) ast.FilterNode

func RegisterDefaultFieldLookup

func RegisterDefaultFieldLookup[T ~string](lookup func(T) *ast.Field)

RegisterDefaultFieldLookup registers a function that can be used to lookup a specific field type.

Types

type KeyedFieldType

type KeyedFieldType string

KeyedFieldType is a type alias for field is a special field type that can be deconstructed into multiple components.

func WithKey

func WithKey[T ~string](field T, key string) KeyedFieldType

func (KeyedFieldType) Field

func (k KeyedFieldType) Field() string

func (KeyedFieldType) Key

func (k KeyedFieldType) Key() string

func (KeyedFieldType) Type

func (k KeyedFieldType) Type() string

Jump to

Keyboard shortcuts

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