Versions in this module Expand all Collapse all v1 v1.2.3 Dec 1, 2024 Changes in this version + func Match(pattern string, data []byte) (bool, error) + func MatchString(pattern, s string) (matched bool, err error) + func Quote(s string) string + func Version() string + type BlockDatabase interface + func NewBlockDatabase(patterns ...*Pattern) (bdb BlockDatabase, err error) + func NewManagedBlockDatabase(patterns ...*Pattern) (BlockDatabase, error) + type BlockMatcher interface + Find func(data []byte) []byte + FindAll func(data []byte, n int) [][]byte + FindAllIndex func(data []byte, n int) [][]int + FindAllString func(s string, n int) []string + FindAllStringIndex func(s string, n int) [][]int + FindIndex func(data []byte) []int + FindString func(s string) string + FindStringIndex func(s string) []int + Match func(b []byte) bool + MatchString func(s string) bool + type BlockScanner interface + Scan func(data []byte, scratch *Scratch, handler Handler, context interface{}) error + type Builder interface + Build func(mode CompileMode) (Database, error) + ForPlatform func(mode CompileMode, platform hyperscan.Platform) (Database, error) + type Callback = ch.Callback + const Continue + const SkipPattern + const Terminate + type Capture = ch.Capture + type CompileError = ch.CompileError + type CompileFlag = ch.CompileFlag + const Caseless + const DotAll + const MultiLine + const SingleMatch + const UnicodeProperty + const Utf8Mode + func ParseCompileFlag(s string) (CompileFlag, error) + type CompileMode = ch.CompileMode + const Groups + const NoGroups + type Database interface + Close func() error + Info func() (DbInfo, error) + Size func() (int, error) + func Compile(expr string) (Database, error) + func MustCompile(expr string) Database + type DatabaseBuilder struct + MatchLimit uint + MatchLimitRecursion uint + Mode CompileMode + func (b *DatabaseBuilder) AddExpressionWithFlags(expr string, flags CompileFlag) *DatabaseBuilder + func (b *DatabaseBuilder) AddExpressions(exprs ...string) *DatabaseBuilder + func (b *DatabaseBuilder) Build() (Database, error) + type DbInfo string + func (i DbInfo) Mode() (hyperscan.ModeFlag, error) + func (i DbInfo) Parse() (version, features, mode string, err error) + func (i DbInfo) String() string + func (i DbInfo) Version() (string, error) + type Error = ch.Error + const ErrBadAlign + const ErrBadAlloc + const ErrCompileError + const ErrDatabaseModeError + const ErrDatabasePlatformError + const ErrDatabaseVersionError + const ErrInvalid + const ErrNoMemory + const ErrScanTerminated + const ErrScratchInUse + const ErrSuccess + type ErrorEvent = ch.ErrorEvent + const ErrMatchLimit + const ErrRecursionLimit + type Handler interface + OnError func(event ErrorEvent, id uint, info, context interface{}) Callback + OnMatch func(id uint, from, to uint64, flags uint, captured []*Capture, context interface{}) Callback + type HandlerFunc func(id uint, from, to uint64, flags uint, captured []*Capture, context interface{}) Callback + func (f HandlerFunc) OnError(event ErrorEvent, id uint, info, context interface{}) Callback + func (f HandlerFunc) OnMatch(id uint, from, to uint64, flags uint, captured []*Capture, ctx interface{}) Callback + type Pattern ch.Pattern + func NewPattern(expr string, flags CompileFlag) *Pattern + func ParsePattern(s string) (*Pattern, error) + func (p *Pattern) Build(mode CompileMode) (Database, error) + func (p *Pattern) ForPlatform(mode CompileMode, platform hyperscan.Platform) (Database, error) + func (p *Pattern) String() string + type Patterns []*Pattern + func ParsePatterns(r io.Reader) (patterns Patterns, err error) + func (p Patterns) Build(mode CompileMode) (Database, error) + func (p Patterns) ForPlatform(mode CompileMode, platform hyperscan.Platform) (Database, error) + func (p Patterns) Patterns() (r []*ch.Pattern) + type Scratch struct + func NewManagedScratch(db Database) (*Scratch, error) + func NewScratch(db Database) (*Scratch, error) + func (s *Scratch) Clone() (*Scratch, error) + func (s *Scratch) Free() error + func (s *Scratch) Realloc(db Database) error + func (s *Scratch) Size() (int, error)