Documentation
¶
Overview ¶
Package kql implements a subset of the Kusto Query Language for the Azure Monitor Logs emulator.
Index ¶
- func FormatTime(t time.Time) string
- func FormatTimespan(d time.Duration) string
- func NormalizeJSON(v any) any
- func Parse(src string) error
- func ParseDatetime(s string) (time.Time, bool)
- func ParseTimespan(s string) (time.Duration, bool)
- func ResultValue(t Type, v any) any
- func ToString(v any) string
- type Col
- type Error
- type Options
- type Rel
- type Resolver
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatTime ¶
FormatTime renders a datetime the way the query API returns it.
func FormatTimespan ¶
FormatTimespan renders a timespan as [-][d.]hh:mm:ss[.fffffff].
func NormalizeJSON ¶
NormalizeJSON converts decoded JSON (float64 numbers) into engine dynamic values.
func ParseDatetime ¶
ParseDatetime parses the datetime formats KQL literals and ingested JSON accept.
func ParseTimespan ¶
ParseTimespan parses KQL timespan literal bodies such as 1d, 00:00:05 or 1.02:03:04.
func ResultValue ¶
ResultValue converts a cell to its query-API JSON representation.
Types ¶
type Error ¶
type Error struct {
// Kind is the inner error code: SyntaxError or SemanticError.
Kind string
// Code is the innermost code, e.g. SYN0002 or SEM0100.
Code string
Message string
}
Error is a query failure in the documented BadArgumentError shape.
type Rel ¶
Rel is a materialised table. Cells hold nil, bool, int64, float64, string, time.Time, time.Duration, []any or map[string]any.
type Resolver ¶
type Resolver interface {
// Table returns the named table of the workspace ("" is the query's own workspace).
Table(workspace, name string) (*Rel, bool)
}
Resolver supplies workspace tables to the engine.