parser

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RunID     = "run_id"
	RunName   = "run_name"
	Created   = "created"
	StartTime = "start_time"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AndExpr

type AndExpr struct {
	Exprs []*CompareExpr
}

AND.

func Parse

func Parse(tokens []lexer.Token) (*AndExpr, error)

type CompareExpr

type CompareExpr struct {
	Left     Identifier
	Operator OperatorKind
	Right    Value
}

a operator b.

func (*CompareExpr) String

func (expr *CompareExpr) String() string

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewParserError

func NewParserError(format string, a ...any) *Error

func (*Error) Error

func (e *Error) Error() string

type Identifier

type Identifier struct {
	Identifier string
	Key        string
}

identifier.key expression, like metric.foo.

func (Identifier) String

func (i Identifier) String() string

type NumberExpr

type NumberExpr struct {
	Value float64
}

func (NumberExpr) String

func (n NumberExpr) String() string

type OperatorKind

type OperatorKind int
const (
	Equals OperatorKind = iota
	NotEquals
	Less
	LessEquals
	Greater
	GreaterEquals
	Like
	ILike
	In //nolint:varnamelen
	NotIn
)

func (OperatorKind) String

func (op OperatorKind) String() string

type StringExpr

type StringExpr struct {
	Value string
}

func (StringExpr) String

func (n StringExpr) String() string

type StringListExpr

type StringListExpr struct {
	Values []string
}

func (StringListExpr) String

func (n StringListExpr) String() string

type ValidCompareExpr

type ValidCompareExpr struct {
	Identifier ValidIdentifier
	Key        string
	Operator   OperatorKind
	Value      interface{}
}

func ValidateExpression

func ValidateExpression(expression *CompareExpr) (*ValidCompareExpr, error)

Validate an expression according to the mlflow domain. This represent is a simple type-checker for the expression. Not every identifier is valid according to the mlflow domain. The same for the value part.

func (ValidCompareExpr) String

func (v ValidCompareExpr) String() string

type ValidIdentifier

type ValidIdentifier int
const (
	Metric ValidIdentifier = iota
	Parameter
	Tag
	Attribute
	Dataset
)

func (ValidIdentifier) String

func (v ValidIdentifier) String() string

type ValidationError

type ValidationError struct {
	// contains filtered or unexported fields
}

func NewValidationError

func NewValidationError(format string, a ...interface{}) *ValidationError

func (*ValidationError) Error

func (e *ValidationError) Error() string

type Value

type Value interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL