ottl

package
v0.0.0-...-512d6ac Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LValue

type LValue []string

LValue represents a field (path) that can be written to.

func (LValue) Delete

func (a LValue) Delete() Statements

Delete removes a (potentially nested) key from its parent maps, if that key exists.

func (LValue) DeleteIf

func (a LValue) DeleteIf(cond Value) Statements

Delete removes a (potentially nested) key from its parent maps, if that key exists.

func (LValue) IsPresent

func (a LValue) IsPresent() Value

IsPresent returns true if the field is recursively present (with any value)

func (LValue) KeepKeys

func (a LValue) KeepKeys(keys ...string) Statements

func (LValue) MergeMaps

func (a LValue) MergeMaps(source Value, strategy string) Statements

func (LValue) MergeMapsIf

func (a LValue) MergeMapsIf(source Value, strategy string, condition Value) Statements

func (LValue) Set

func (a LValue) Set(b Value) Statements

func (LValue) SetIf

func (a LValue) SetIf(b, condition Value) Statements

func (LValue) SetIfNil

func (a LValue) SetIfNil(b Value) Statements

func (LValue) SetToBool

func (a LValue) SetToBool(b Value) Statements

func (LValue) String

func (path LValue) String() string

type RValue

type RValue string

RValue represents an arbitrary expression that can be evaluated to a value.

func (RValue) String

func (v RValue) String() string

type Statement

type Statement string

type Statements

type Statements []Statement

func NewStatements

func NewStatements(a ...Statements) Statements

func (Statements) Append

func (a Statements) Append(b ...Statements) Statements

type Value

type Value interface {
	fmt.Stringer
}

Value represents something that has a value in OTTL (either LValue or RValue)

func And

func And(conditions ...Value) Value

func ConvertCase

func ConvertCase(a Value, toCase string) Value

func Equals

func Equals(a, b Value) Value

func False

func False() Value

func IntLiteral

func IntLiteral(v int) Value

func IsMatch

func IsMatch(target Value, pattern string) Value

func IsNotNil

func IsNotNil(a Value) Value

func Nil

func Nil() Value

func Not

func Not(a Value) Value

func Or

func Or(conditions ...Value) Value

func ParseJSON

func ParseJSON(a Value) Value

func StringLiteral

func StringLiteral(v string) Value

func ToFloat

func ToFloat(a Value) Value

func ToInt

func ToInt(a Value) Value

func ToString

func ToString(a Value) Value

func ToTime

func ToTime(a Value, strpformat string) Value

func True

func True() Value

Jump to

Keyboard shortcuts

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