metafilter

package
v0.0.0-...-9799ab4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterList

func FilterList(
	in_objects interface{},
	filters Filters,
	functions FilterFunctions,
	prefilled bool,
	eqcheckfunc set2.EQCheckFunc,
) (
	interface{},
	error,
)

Filters subject date passed by in_objects, with filter set passed by filters. functions should contain functions asked by filters.

func FilterListItem

func FilterListItem(
	item interface{},
	filters Filters,
	functions FilterFunctions,
	prefilled bool,
	check_filters bool,
) (
	remove bool,
	err error,
)

Types

type FilterFunction

type FilterFunction func(
	parameter string,
	value_to_match interface{},
) (bool, error)

type FilterFunctions

type FilterFunctions map[string]FilterFunction

type FilterItem

type FilterItem struct {
	// if [function result]+[NotFunc] == true.
	// if Add == true, then value which is chacked by this filter item,
	// considered to be added to result,
	// else, if Add == false, - item should be removed from result
	Add bool

	// apply boolean not to function result
	NotFunc bool

	// name of function, which FilterList have to use
	Func string

	// some functioning data, to be passed to function
	FuncParam string
}

structure for one of items of filter text parse result

type Filters

type Filters []*FilterItem

func ParseFilterText

func ParseFilterText(text string) (Filters, error)

func ParseFilterTextLines

func ParseFilterTextLines(text []string) (Filters, error)

func ParseFilterTextLinesMust

func ParseFilterTextLinesMust(text []string) Filters

func ParseFilterTextMust

func ParseFilterTextMust(text string) Filters

Jump to

Keyboard shortcuts

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