filter

package
v1.201.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolFilter

type BoolFilter struct {
	Field string
	Value *bool // nil = all, true = enabled only, false = disabled only
}

BoolFilter filters by boolean field.

func NewBoolFilter

func NewBoolFilter(field string, value *bool) *BoolFilter

NewBoolFilter creates a filter for boolean field values. Value nil = all, true = only true values, false = only false values.

func (*BoolFilter) Apply

func (f *BoolFilter) Apply(data interface{}) (interface{}, error)

Apply filters data by boolean field value.

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

Chain combines multiple filters (AND logic).

func NewChain

func NewChain(filters ...Filter) *Chain

NewChain creates a filter chain that applies filters in sequence (AND logic).

func (*Chain) Apply

func (c *Chain) Apply(data interface{}) (interface{}, error)

Apply applies all filters in sequence.

type ColumnValueFilter

type ColumnValueFilter struct {
	Column string
	Value  string
}

ColumnValueFilter filters rows by column value.

func NewColumnFilter

func NewColumnFilter(column, value string) *ColumnValueFilter

NewColumnFilter creates a filter for exact column value matching.

func (*ColumnValueFilter) Apply

func (f *ColumnValueFilter) Apply(data interface{}) (interface{}, error)

Apply filters data by exact column value match.

type Filter

type Filter interface {
	Apply(data interface{}) (interface{}, error)
}

Filter interface for composability.

type GlobFilter

type GlobFilter struct {
	Field   string
	Pattern string
}

GlobFilter matches patterns (e.g., "plat-*-dev").

func NewGlobFilter

func NewGlobFilter(field, pattern string) (*GlobFilter, error)

NewGlobFilter creates a filter that matches field values against glob pattern.

func (*GlobFilter) Apply

func (f *GlobFilter) Apply(data interface{}) (interface{}, error)

Apply filters data by glob pattern matching.

Jump to

Keyboard shortcuts

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