selector

package
v1.1.0-beta.0...-3047328 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Insert means insert a new rule
	Insert int = iota
	// Replace means update an old rule
	Replace
	// Append means delete an old rule
	Append
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RuleSet

type RuleSet []any

RuleSet is a set of rules that selected

type Selector

type Selector interface {
	// Insert will insert one rule into trie
	// if table is empty, insert rule into schema level
	// otherwise insert rule into table level
	Insert(schema, table string, rule any, insertType int) error
	// Match will return all matched rules
	Match(schema, table string) RuleSet
	// Remove will remove one rule
	Remove(schema, table string) error
	// AllRules will returns all rules
	AllRules() (map[string][]any, map[string]map[string][]any)
}

Selector stores rules of schema/table for easy retrieval

func NewTrieSelector

func NewTrieSelector() Selector

NewTrieSelector returns a trie Selector

Jump to

Keyboard shortcuts

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