Documentation ¶
Index ¶
Constants ¶
const ( Number ValueType = "number" String ValueType = "string" Bool ValueType = "bool" Time ValueType = "time" Duration ValueType = "duration" DigitalUnit ValueType = "digital_unit" // Decimal Byte = 1 KB = Byte * 1000 MB = KB * 1000 GB = MB * 1000 TB = GB * 1000 PB = TB * 1000 // Binary KiB = Byte * 1024 MiB = KiB * 1024 GiB = MiB * 1024 TiB = GiB * 1024 PiB = TiB * 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataParser ¶
type DataParser interface { Parse(ctx context.Context, data io.Reader) (results <-chan Result) ParseBytes(ctx context.Context, data []byte) (results <-chan Result) }
DataParser interface
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser type
func MustNewParser ¶
MustNewParser is like NewParser but panics on error
type ParserOpt ¶
ParserOpt functional options for Parser
func ContinueTag ¶
ContinueTag sets a regexp that when match the parser will resume after SkipTag
func FindAll ¶
func FindAll() (opt ParserOpt)
FindAll successive matches for the specified LineRegex
func LineRegex ¶
LineRegex sets a regexp for this parser making the extraction to work in line mode and ignore all Values regexps. Working in line mode is much faster than in Set using Value regexp. Multiline regexps `(?m)` are still valid, but usually are slower than using Values regexps.
func StartTag ¶
StartTag sets a regexp that will be used to start the match and extract when working in Set mode (Value regexp)
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represent each singular value to extract, parse and transform
func MustNewValue ¶
MustNewValue is like NewValue but panics on error
type ValueOpt ¶
ValueOpt functional options for Value
func FromFormat ¶
FromFormat sets the from format for this value parser
func Nullable ¶
func Nullable() (opt ValueOpt)
Nullable sets the value to null on parsing errors and ignores the error
func ValueRegex ¶
ValueRegex sets the regexp for this value parser
type ValueParser ¶
ValueParser interface