Documentation
¶
Index ¶
Constants ¶
View Source
const ( FilterIntersectChar rune = '&' FilterUnionChar rune = '+' FilterExcludeChar rune = '-' FilterHighlightChar rune = '~' )
View Source
const FilterMinLength int = 2
Variables ¶
View Source
var CaseSensitive = SearchType{
Color: termbox.ColorYellow,
Name: "CaseS",
}
View Source
var ErrBadFilterDefinition = errors.New("Bad filter definition")
View Source
var FilterActionMap = map[rune]FilterAction{ FilterIntersectChar: FilterIntersect, FilterUnionChar: FilterUnion, FilterExcludeChar: FilterExclude, FilterHighlightChar: FilterHighlight, }
View Source
var RegEx = SearchType{
Color: termbox.ColorRed,
Name: "RegEx",
}
View Source
var SearchTypeMap map[uint8]SearchType
Functions ¶
func IndexAll ¶
func IndexAll(searchFunc SearchFunc, runestack []rune) (indices [][]int)
Types ¶
type ActionFunc ¶
type ActionFunc func(str []rune, currentAction FilterResult) FilterResult
type Filter ¶
type Filter struct { Action FilterAction TakeAction ActionFunc // contains filtered or unexported fields }
func NewFilter ¶
func NewFilter(sub []rune, action FilterAction, searchType SearchType) (*Filter, error)
func ParseFiltersFile ¶
func ParseFiltersOpt ¶
type FilterAction ¶
type FilterAction uint8
const ( FilterIntersect FilterAction = iota FilterUnion FilterExclude FilterHighlight )
type FilterResult ¶
type FilterResult uint8
const ( FilterNoaction FilterResult = iota FilterIncluded FilterExcluded FilterHighlighted )
type FilterTooShortError ¶
func (*FilterTooShortError) Error ¶
func (e *FilterTooShortError) Error() string
type SearchFunc ¶
Follows regex return value pattern. nil if not found, slice of range if found Filter does not really need it, but highlighting also must search and requires it
func GetSearchFunc ¶
func GetSearchFunc(searchType SearchType, sub []rune) (SearchFunc, error)
type SearchType ¶
type UnknownFilterTypeError ¶
func (*UnknownFilterTypeError) Error ¶
func (e *UnknownFilterTypeError) Error() string
Click to show internal directories.
Click to hide internal directories.