Documentation ¶
Index ¶
- Variables
- func Default() string
- func Engines() []string
- func New(name, re string) (Matcher, Disposer, error)
- func NewGo(re string) (Matcher, Disposer, error)
- func Register(name string, c Constructor) error
- func SetDefault(name string)
- type Constructor
- type DisposableMatcher
- type Disposer
- type Go
- type Matcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRegexAlreadyRegistered is returned when there is a previously // registered regex engine with the same name. ErrRegexAlreadyRegistered = errors.NewKind("Regex engine already registered: %s") // ErrRegexNameEmpty returned when the name is "". ErrRegexNameEmpty = errors.NewKind("Regex engine name cannot be empty") // ErrRegexNotFound returned when the regex engine is not registered. ErrRegexNotFound = errors.NewKind("Regex engine not found: %s") )
View Source
var ( // CompileHistogram describes a regexp compile time. CompileHistogram = discard.NewHistogram() // MatchHistogram describes a regexp match time. MatchHistogram = discard.NewHistogram() )
Functions ¶
func Register ¶
func Register(name string, c Constructor) error
Register add a new regex engine to the registry.
func SetDefault ¶
func SetDefault(name string)
SetDefault sets the regex engine returned by Default.
Types ¶
type Constructor ¶
Constructor creates a new Matcher.
type DisposableMatcher ¶
DisposableMatcher implements both Disposer and Matcher
func NewDisposableMatcher ¶
func NewDisposableMatcher(name, re string) (DisposableMatcher, error)
type Disposer ¶
type Disposer interface {
Dispose()
}
Disposer interface is used to release resources. The interface should be implemented by all go binding for native C libraries
Click to show internal directories.
Click to hide internal directories.