filter

package
v0.0.0-...-0fdad32 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DateMap

type DateMap = map[string][]DateRange

type DateRange

type DateRange struct {
	From time.Time
	To   time.Time
}

DateRange is a simple struct representing a slice of time From a point To a point

type DateValue

type DateValue struct {
	Value    DateRange
	Modifier FilterModifier
}

func DateVal

func DateVal(val DateRange) DateValue

DateVal is a shorthand method for creating a standard, un-modified value.

func NotDateVal

func NotDateVal(val DateRange) DateValue

NotDateVal is a shorthand method for creating a filter value with the Not modification.

type DateValues

type DateValues []DateValue

func (DateValues) SplitByModifier

func (f DateValues) SplitByModifier() map[FilterModifier][]DateRange

SplitByModifier divides up a Values into pieces based on what its modifier is.

func (DateValues) SplitValues

func (f DateValues) SplitValues(partitionFn func(DateValue) string) DateMap

SplitValues divides a Values into a map, based on the given partitioning function

func (DateValues) Value

func (f DateValues) Value(index int) DateRange

Value is a shorthand method for retriving the string at a particular index

func (DateValues) Values

func (f DateValues) Values() []DateRange

Values converts a filter.Values into a string slice for easier consumption essentially [].map(fv => fv.Value) in javascript

type FilterModifier

type FilterModifier int64
const (
	Normal FilterModifier = 0
	Not    FilterModifier = 1 << (iota)
)

type Value

type Value struct {
	Value    string
	Modifier FilterModifier
}

func NotVal

func NotVal(n string) Value

NotVal is a shorthand method for creating a filter value with the Not modification.

func Val

func Val(n string) Value

Val is a shorthand method for creating a standard, un-modified value.

type Values

type Values []Value

func (Values) SplitByModifier

func (f Values) SplitByModifier() map[FilterModifier][]string

SplitByModifier divides up a Values into pieces based on what its modifier is.

func (Values) SplitValues

func (f Values) SplitValues(partitionFn func(Value) string) map[string][]string

SplitValues divides a Values into a map, based on the given partitioning function

func (Values) Value

func (f Values) Value(index int) string

Value is a shorthand method for retriving the string at a particular index

func (Values) Values

func (f Values) Values() []string

Values converts a filter.Values into a string slice for easier consumption essentially [].map(fv => fv.Value) in javascript

Jump to

Keyboard shortcuts

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