xfilter

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Text    = "text"
	Number  = "number"
	Select  = "select"
	Boolean = "boolean"
	Date    = "date"
)

Variables

View Source
var (
	TextOperation = []string{
		"is",
		"is_not",
		"contains",
		"does_not_contain",
		"star_with",
		"end_with",
		"is_empty",
		"is_not_empty",
	}

	NumberOperation = []string{
		"is",
		"is_not",
		"is_equal",
		"is_not_equal",
		"is_greater_than",
		"is_less_than",
		"is_greater_than_or_equal",
		"is_less_than_or_equal",
		"is_empty",
		"is_not_empty",
	}

	SelectOperation = []string{
		"is",
		"is_not",
		"is_empty",
		"is_not_empty",
	}

	BooleanOperation = []string{
		"is",
		"is_empty",
		"is_not_empty",
	}

	DateOperation = []string{
		"is",
		"is_before",
		"is_after",
		"is_on_or_before",
		"is_on_or_after",
		"is_between",
		"is_empty",
		"is_not_empty",
	}
)

Functions

This section is empty.

Types

type Build

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

func NewBuild

func NewBuild(filterBy map[string]Filter, configs []Config) *Build

func (*Build) ToExpression

func (b *Build) ToExpression() (exps []exp.Expression)

type BuildBool

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

func (*BuildBool) Build

func (b *BuildBool) Build() exp.Expression

type BuildDate

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

func (*BuildDate) Build

func (b *BuildDate) Build() exp.Expression

type BuildNumber

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

func (*BuildNumber) Build

func (b *BuildNumber) Build() exp.Expression

type BuildSelect

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

func (*BuildSelect) Build

func (b *BuildSelect) Build() exp.Expression

type BuildText

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

func (*BuildText) Build

func (b *BuildText) Build() exp.Expression

type Builder

type Builder interface {
	Build() exp.Expression
}

func NewBuildBool

func NewBuildBool(column string, filter Filter) Builder

func NewBuildDate

func NewBuildDate(column string, filter Filter) Builder

func NewBuildNumber

func NewBuildNumber(column string, filter Filter) Builder

func NewBuildSelect

func NewBuildSelect(column string, filter Filter) Builder

func NewBuildText

func NewBuildText(column string, filter Filter) Builder

type BuilderFn

type BuilderFn = func(string, Filter) Builder

type Config

type Config struct {
	Column        string         `json:"column"`
	Label         string         `json:"label"`
	Field         string         `json:"field"`
	Type          string         `json:"type"`
	Description   string         `json:"description"`
	Suggestion    bool           `json:"suggestion"`
	Disabled      bool           `json:"disabled"`
	DefaultValues []DefaultValue `json:"default_values"`
	Operations    []string       `json:"operations"`
}

type DefaultValue

type DefaultValue struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

type Filter

type Filter struct {
	Type      string   `json:"type"`
	Operation string   `json:"operation"`
	Values    []string `json:"values"`
	Disabled  bool     `json:"disabled"`
}

Jump to

Keyboard shortcuts

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