search

package
v0.1.4-dev Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSearchSyntax = errors.New("invalid search syntax")

Functions

This section is empty.

Types

type Order

type Order struct {
	Name string
	Desc bool
}

func ParseOrderByString

func ParseOrderByString(text string) []Order

type SearchData

type SearchData map[string][]SearchValue

func ParseSearchString

func ParseSearchString(text string) (SearchData, error)

func ParseSearchString2

func ParseSearchString2(text string) (SearchData, error)

func (SearchData) SearchDB

func (m SearchData) SearchDB(db *gorm.DB, handleFuncs map[string]SearchDataHandleFunc) *gorm.DB

func (SearchData) String

func (s SearchData) String() string

func (SearchData) WhereString

func (m SearchData) WhereString(handleFuncs SearchDataHandleFuncMap) (string, []any, error)

type SearchDataHandleFunc

type SearchDataHandleFunc func(values []SearchValue) (string, []any)

type SearchDataHandleFuncMap

type SearchDataHandleFuncMap map[string]SearchDataHandleFunc

type SearchSymbol

type SearchSymbol string
var (
	SearchSymbolNone   SearchSymbol = ""
	SearchSymbolRange  SearchSymbol = ".."
	SearchSymbolNot    SearchSymbol = "!="
	SearchSymbolEq     SearchSymbol = "="
	SearchSymbolGt     SearchSymbol = ">"
	SearchSymbolGte    SearchSymbol = ">="
	SearchSymbolLt     SearchSymbol = "<"
	SearchSymbolLte    SearchSymbol = "<="
	SearchSymbolSearch SearchSymbol = "search"
)

type SearchValue

type SearchValue struct {
	Symbol SearchSymbol
	Value  any
	Value2 any
}

func (SearchValue) String

func (v SearchValue) String() string

Jump to

Keyboard shortcuts

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