mo_filter

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MFilter = app_msg.Apply(&MsgFilter{}).(*MsgFilter)
)

Functions

func ExpectString

func ExpectString(v interface{}, f func(s string) bool) bool

Types

type Acceptor

type Acceptor interface {
	Accept(v interface{}) bool
}

type Filter

type Filter interface {
	Acceptor
	mo_multi.MultiValue

	SetOptions(o ...FilterOpt)

	// Debug information
	Debug() interface{}

	// Weather the filter enabled or not.
	// Note: Accept() will return true when the filter is not enabled.
	IsEnabled() bool
}

func New

func New(name string) Filter

type FilterOpt

type FilterOpt interface {
	Acceptor

	// Bind variable for configure flag
	Bind() interface{}

	// Filter option name suffix.
	NameSuffix() string

	// Description of this filter option.
	Desc() app_msg.Message

	// True if the option enabled thru the flag.
	Enabled() bool

	// Serialize settings
	Capture() interface{}

	// Restore settings
	Restore(v es_json.Json) error
}

func NewEmailFilter

func NewEmailFilter() FilterOpt

func NewNameFilter

func NewNameFilter() FilterOpt

func NewNamePrefixFilter

func NewNamePrefixFilter() FilterOpt

func NewNameSuffixFilter

func NewNameSuffixFilter() FilterOpt

func NewTestNameFilter

func NewTestNameFilter(name string) FilterOpt

type MsgFilter

type MsgFilter struct {
	DescFilterName       app_msg.Message
	DescFilterNamePrefix app_msg.Message
	DescFilterNameSuffix app_msg.Message
	DescFilterEmail      app_msg.Message
}

Jump to

Keyboard shortcuts

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