Documentation ¶
Overview ¶
Package lexerql provides utilities for lexing in *QL languages.
Index ¶
- Constants
- func IsBytesRune[R char](r R) bool
- func IsDigit[R char](r R) bool
- func IsDurationRune[R char](r R) bool
- func IsIdentRune[R char](r R) bool
- func IsIdentStartRune[R char](r R) bool
- func IsLetter[R char](r R) bool
- func ParseDuration(s string) (time.Duration, error)
- func ScanComment(s *scanner.Scanner)
- func ScanDuration(s *scanner.Scanner, number string) (string, error)
- type Unit
- type UnitType
Constants ¶
View Source
const ( // Number is a plain Go number. Number = iota // Duration is a Prometheus/Go duration. Duration // Bytes is a [humanize.Bytes] value. Bytes )
Variables ¶
This section is empty.
Functions ¶
func IsBytesRune ¶ added in v0.1.0
func IsBytesRune[R char](r R) bool
IsBytesRune returns true, if r is a non-digit rune that could be part of bytes.
func IsDurationRune ¶
func IsDurationRune[R char](r R) bool
IsDurationRune returns true, if r is a non-digit rune that could be part of duration.
func IsIdentRune ¶
func IsIdentRune[R char](r R) bool
IsIdentRune returns true, if r is a valid character of Go identifier/Prometheus label.
func IsIdentStartRune ¶
func IsIdentStartRune[R char](r R) bool
IsIdentStartRune returns true, if r is a valid first character of Go identifier/Prometheus label.
func ParseDuration ¶
ParseDuration parses Prometheus or Go duration
Types ¶
Click to show internal directories.
Click to hide internal directories.