Documentation
¶
Overview ¶
Package simpletoken contains a Detector for tokens that can be extracted by scanning a byte array with a regular expression.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detector ¶
type Detector struct {
// The maximum length of the token.
MaxLen uint32
// Matches on the token.
Re *regexp.Regexp
// Returns a veles.Secret from a regexp match.
FromMatch func([]byte) veles.Secret
}
Detector finds instances of a simple token that matches the regular expression Re inside a chunk of text. It implements veles.Detector.
func (Detector) Detect ¶
Detect finds candidate tokens that match Detector.Re and returns them alongside their starting positions.
func (Detector) MaxSecretLen ¶
MaxSecretLen returns the maximum length of the token.
Click to show internal directories.
Click to hide internal directories.