types

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BooleanVal

func BooleanVal(v Value) bool

func EntryFromValue

func EntryFromValue(v Value) (database.Entry, error)

func FloatVal

func FloatVal(v Value) float64

func IntVal

func IntVal(v Value) int64

Types

type Builtin

type Builtin interface {
	Name() string
	Validate(input schema.Object) (schema.Object, error)
	Execute(input Value) Value
}

func LookupBuiltinFunction

func LookupBuiltinFunction(name string) (b Builtin, ok bool)

type BuiltinMax

type BuiltinMax struct{}

func (BuiltinMax) Execute

func (b BuiltinMax) Execute(input Value) Value

func (BuiltinMax) Name

func (b BuiltinMax) Name() string

func (BuiltinMax) Validate

func (b BuiltinMax) Validate(input schema.Object) (schema.Object, error)

type BuiltinMin

type BuiltinMin struct{}

func (BuiltinMin) Execute

func (b BuiltinMin) Execute(input Value) Value

func (BuiltinMin) Name

func (b BuiltinMin) Name() string

func (BuiltinMin) Validate

func (b BuiltinMin) Validate(input schema.Object) (schema.Object, error)

type Kind

type Kind int
const (
	Unknown Kind = iota

	Boolean
	String
	Int
	Float
	Tuple
)

type Value

type Value interface {
	Kind() Kind
}

func BinaryOp

func BinaryOp(left Value, operator parse.Token, right Value) Value

func MakeBoolean

func MakeBoolean(b bool) Value

func MakeFloat

func MakeFloat(f float64) Value

func MakeFromEntry

func MakeFromEntry(entry database.Entry) Value

func MakeFromSchemaType

func MakeFromSchemaType(b []byte, t schema.Type) Value

func MakeFromToken

func MakeFromToken(tok parse.Token) Value

func MakeInt

func MakeInt(i int64) Value

func MakeString

func MakeString(s string) Value

func MakeTuple

func MakeTuple(t []Value) Value

func MakeUnknown

func MakeUnknown() Value

func TupleVal

func TupleVal(v Value) []Value

func UnaryOp

func UnaryOp(operator parse.Token, operand Value) Value

Jump to

Keyboard shortcuts

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