values

package
v0.164.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 22 Imported by: 30

Documentation

Overview

Package values declares the flux data types and implements them.

Index

Constants

This section is empty.

Variables

View Source
var (
	// InvalidValue is a non nil value who's type is semantic.Invalid
	InvalidValue = value{}

	// Null is an untyped nil value.
	Null = null{}

	// Void is an empty record used to represent a void value.
	Void = NewObject(semantic.NewObjectType(nil))
)

Functions

func AllLabels added in v0.68.0

func AllLabels() labelSet

AllLabels returns a label set that represents the infinite set of all possible string labels.

func CheckKind

func CheckKind(got, exp semantic.Nature)

CheckKind panics if got != exp.

func Display added in v0.115.0

func Display(w io.Writer, v Value) error

Display formats the value into the writer

func DisplayString added in v0.115.0

func DisplayString(v Value) string

DisplayString formats the value into a string

func FormattedScope added in v0.40.0

func FormattedScope(scope Scope) fmt.Formatter

FormattedScope produces a fmt.Formatter for pretty printing a scope.

func IsTimeable added in v0.70.0

func IsTimeable(v Value) bool

IsTimeable checks if value v is Timeable.

func NewFunction

func NewFunction(name string, typ semantic.MonoType, call func(ctx context.Context, args Object) (Value, error), sideEffect bool) *function

NewFunction returns a new function value. This function will panic if it is passed anything other than a function type.

func UnexpectedKind

func UnexpectedKind(got, exp semantic.Nature) error

func Unwrap added in v0.69.0

func Unwrap(v Value) interface{}

Unwrap will extract the primitive value from the Value interface.

Types

type Array

type Array interface {
	Value
	Get(i int) Value
	Set(i int, v Value)
	Append(v Value)
	Len() int
	Range(func(i int, v Value))
	Sort(func(i, j Value) bool)
}

Array represents an sequence of elements All elements must be the same type

func NewArray

func NewArray(arrType semantic.MonoType) Array

func NewArrayWithBacking

func NewArrayWithBacking(arrType semantic.MonoType, elements []Value) Array

type BinaryFuncSignature

type BinaryFuncSignature struct {
	Operator    ast.OperatorKind
	Left, Right semantic.Nature
}

type BinaryFunction

type BinaryFunction func(l, r Value) (Value, error)

func LookupBinaryFunction

func LookupBinaryFunction(sig BinaryFuncSignature) (BinaryFunction, error)

LookupBinaryFunction returns an appropriate binary function that evaluates two values and returns another value. If the two types are not compatible with the given operation, this returns an error.

type BooleanVectorValue added in v0.153.0

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

func (*BooleanVectorValue) Arr added in v0.153.0

func (v *BooleanVectorValue) Arr() arrow.Array

func (*BooleanVectorValue) Array added in v0.153.0

func (v *BooleanVectorValue) Array() Array

func (*BooleanVectorValue) Bool added in v0.153.0

func (v *BooleanVectorValue) Bool() bool

func (*BooleanVectorValue) Bytes added in v0.153.0

func (v *BooleanVectorValue) Bytes() []byte

func (*BooleanVectorValue) Dict added in v0.153.0

func (v *BooleanVectorValue) Dict() Dictionary

func (*BooleanVectorValue) Duration added in v0.153.0

func (v *BooleanVectorValue) Duration() Duration

func (*BooleanVectorValue) ElementType added in v0.153.0

func (v *BooleanVectorValue) ElementType() semantic.MonoType

func (*BooleanVectorValue) Equal added in v0.153.0

func (v *BooleanVectorValue) Equal(other Value) bool

func (*BooleanVectorValue) Float added in v0.153.0

func (v *BooleanVectorValue) Float() float64

func (*BooleanVectorValue) Function added in v0.153.0

func (v *BooleanVectorValue) Function() Function

func (*BooleanVectorValue) Int added in v0.153.0

func (v *BooleanVectorValue) Int() int64

func (*BooleanVectorValue) IsNull added in v0.153.0

func (v *BooleanVectorValue) IsNull() bool

func (*BooleanVectorValue) Object added in v0.153.0

func (v *BooleanVectorValue) Object() Object

func (*BooleanVectorValue) Regexp added in v0.153.0

func (v *BooleanVectorValue) Regexp() *regexp.Regexp

func (*BooleanVectorValue) Release added in v0.153.0

func (v *BooleanVectorValue) Release()

func (*BooleanVectorValue) Retain added in v0.153.0

func (v *BooleanVectorValue) Retain()

func (*BooleanVectorValue) Str added in v0.153.0

func (v *BooleanVectorValue) Str() string

func (*BooleanVectorValue) Time added in v0.153.0

func (v *BooleanVectorValue) Time() Time

func (*BooleanVectorValue) Type added in v0.153.0

func (*BooleanVectorValue) UInt added in v0.153.0

func (v *BooleanVectorValue) UInt() uint64

func (*BooleanVectorValue) Vector added in v0.154.0

func (v *BooleanVectorValue) Vector() Vector

type Dictionary added in v0.96.0

type Dictionary interface {
	Value

	// Get will retrieve a Value out of the Dictionary.
	// If the key is not present, the def Value will
	// be returned instead.
	Get(key, def Value) Value

	// Insert will insert a Value into the Dictionary
	// using the key and value. It will return a new
	// Dictionary with the key/value inserted. If the
	// key was already in the Dictionary, it will
	// be replaced.
	//
	// Attempting to insert a null value for the key
	// will return an error.
	Insert(key, value Value) (Dictionary, error)

	// Remove will remove the key/value pair that
	// matches with the key. It will return a new
	// Dictionary with the key/value removed.
	Remove(key Value) Dictionary

	// Range will iterate over each element in
	// the Dictionary.
	Range(func(key, value Value))

	// Len returns the number of elements inside of
	// Dictionary.
	Len() int
}

Dictionary defines the interface for a dictionary.

A Dictionary is immutable. Changes to a Dictionary will return a new Dictionary.

func NewDict added in v0.96.0

func NewDict(dictType semantic.MonoType) Dictionary

NewDict will construct a new Dictionary with the given key type.

func NewEmptyDict added in v0.99.0

func NewEmptyDict(ty semantic.MonoType) Dictionary

NewEmptyDict will construct an empty dictionary

type DictionaryBuilder added in v0.96.0

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

DictionaryBuilder can be used to construct a Dictionary with in-place memory instead of successive Insert calls that create new Dictionary values.

func NewDictBuilder added in v0.96.0

func NewDictBuilder(dictType semantic.MonoType) DictionaryBuilder

NewDictBuilder will create a new DictionaryBuilder for the given key type.

func (*DictionaryBuilder) Dict added in v0.96.0

func (d *DictionaryBuilder) Dict() Dictionary

Dict will construct a new Dictionary using the inserted values.

func (*DictionaryBuilder) Get added in v0.96.0

func (d *DictionaryBuilder) Get(key Value) (Value, bool)

Get will retrieve a Value if it is present.

func (*DictionaryBuilder) Insert added in v0.96.0

func (d *DictionaryBuilder) Insert(key, value Value) error

Insert will insert a new key/value pair into the Dictionary.

func (*DictionaryBuilder) Remove added in v0.96.0

func (d *DictionaryBuilder) Remove(key Value)

Remove will remove a key/value pair from the Dictionary.

type Duration

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

Duration is a vector representing the duration unit components.

func ConvertDurationMonths added in v0.83.3

func ConvertDurationMonths(v time.Duration) Duration

ConvertDurationMonths takes a time.Duration and converts it into a Duration with months.

func ConvertDurationNsecs added in v0.84.0

func ConvertDurationNsecs(v time.Duration) Duration

ConvertDurationNsecs takes a time.Duration and converts it into a Duration with nanoseconds.

func FromDurationValues added in v0.53.0

func FromDurationValues(dur []ast.Duration) (d Duration, err error)

FromDurationValues creates a duration value from the duration values.

func MakeDuration added in v0.83.3

func MakeDuration(nsecs int64, months int64, negative bool) Duration

MakeDuration takes nanoseconds and months as int64 and negative as a bool to construct a Duration with mixed units

func ParseDuration

func ParseDuration(s string) (Duration, error)

func (Duration) AsValues added in v0.53.0

func (d Duration) AsValues() []ast.Duration

AsValues will reconstruct the duration as a set of values. All of the components will be positive numbers.

func (Duration) Duration

func (d Duration) Duration() time.Duration

Duration will return the nanosecond equivalent of this duration. It will assume that all months are the same length.

It is recommended not to use this method unless it is absolutely needed. This method will lose any precision that is present in the Duration and it should only be used for interfacing with outside code that is not month-aware.

func (Duration) Equal added in v0.51.0

func (d Duration) Equal(other Duration) bool

Equal returns true if the two durations are equal.

func (Duration) IsMixed added in v0.102.0

func (d Duration) IsMixed() bool

IsMixed returns true if this duration has a combination of month and nanosecond components.

func (Duration) IsNegative added in v0.53.0

func (d Duration) IsNegative() bool

IsNegative returns true if this is a negative number. It returns false if the number is zero.

func (Duration) IsPositive added in v0.51.0

func (d Duration) IsPositive() bool

IsPositive returns true if this is a positive number. It returns false if the number is zero.

func (Duration) IsZero added in v0.51.0

func (d Duration) IsZero() bool

IsZero returns true if this is a zero duration.

func (Duration) MarshalText added in v0.51.0

func (d Duration) MarshalText() ([]byte, error)

func (Duration) Months added in v0.53.0

func (d Duration) Months() int64

func (Duration) MonthsOnly added in v0.92.0

func (d Duration) MonthsOnly() bool

MonthsOnly returns true if this duration does not have a nanosecond component.

func (Duration) Mul added in v0.51.0

func (d Duration) Mul(scale int) Duration

Mul will multiply the Duration by a scalar. This multiplies each component of the vector.

func (Duration) NanoOnly added in v0.92.0

func (d Duration) NanoOnly() bool

NanoOnly returns true if this duration does not have a month component.

func (Duration) Nanoseconds added in v0.53.0

func (d Duration) Nanoseconds() int64

func (Duration) Normalize added in v0.51.0

func (d Duration) Normalize(interval Duration) Duration

Normalize will normalize the duration within the interval. It will ensure that the output duration is the smallest positive duration that is the equivalent of the current duration.

func (Duration) String

func (d Duration) String() string

func (*Duration) UnmarshalText added in v0.51.0

func (d *Duration) UnmarshalText(data []byte) error

type FloatVectorValue added in v0.153.0

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

func (*FloatVectorValue) Arr added in v0.153.0

func (v *FloatVectorValue) Arr() arrow.Array

func (*FloatVectorValue) Array added in v0.153.0

func (v *FloatVectorValue) Array() Array

func (*FloatVectorValue) Bool added in v0.153.0

func (v *FloatVectorValue) Bool() bool

func (*FloatVectorValue) Bytes added in v0.153.0

func (v *FloatVectorValue) Bytes() []byte

func (*FloatVectorValue) Dict added in v0.153.0

func (v *FloatVectorValue) Dict() Dictionary

func (*FloatVectorValue) Duration added in v0.153.0

func (v *FloatVectorValue) Duration() Duration

func (*FloatVectorValue) ElementType added in v0.153.0

func (v *FloatVectorValue) ElementType() semantic.MonoType

func (*FloatVectorValue) Equal added in v0.153.0

func (v *FloatVectorValue) Equal(other Value) bool

func (*FloatVectorValue) Float added in v0.153.0

func (v *FloatVectorValue) Float() float64

func (*FloatVectorValue) Function added in v0.153.0

func (v *FloatVectorValue) Function() Function

func (*FloatVectorValue) Int added in v0.153.0

func (v *FloatVectorValue) Int() int64

func (*FloatVectorValue) IsNull added in v0.153.0

func (v *FloatVectorValue) IsNull() bool

func (*FloatVectorValue) Object added in v0.153.0

func (v *FloatVectorValue) Object() Object

func (*FloatVectorValue) Regexp added in v0.153.0

func (v *FloatVectorValue) Regexp() *regexp.Regexp

func (*FloatVectorValue) Release added in v0.153.0

func (v *FloatVectorValue) Release()

func (*FloatVectorValue) Retain added in v0.153.0

func (v *FloatVectorValue) Retain()

func (*FloatVectorValue) Str added in v0.153.0

func (v *FloatVectorValue) Str() string

func (*FloatVectorValue) Time added in v0.153.0

func (v *FloatVectorValue) Time() Time

func (*FloatVectorValue) Type added in v0.153.0

func (*FloatVectorValue) UInt added in v0.153.0

func (v *FloatVectorValue) UInt() uint64

func (*FloatVectorValue) Vector added in v0.154.0

func (v *FloatVectorValue) Vector() Vector

type Function

type Function interface {
	Value
	HasSideEffect() bool
	Call(ctx context.Context, args Object) (Value, error)
}

Function represents a callable type

type IntVectorValue added in v0.153.0

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

func (*IntVectorValue) Arr added in v0.153.0

func (v *IntVectorValue) Arr() arrow.Array

func (*IntVectorValue) Array added in v0.153.0

func (v *IntVectorValue) Array() Array

func (*IntVectorValue) Bool added in v0.153.0

func (v *IntVectorValue) Bool() bool

func (*IntVectorValue) Bytes added in v0.153.0

func (v *IntVectorValue) Bytes() []byte

func (*IntVectorValue) Dict added in v0.153.0

func (v *IntVectorValue) Dict() Dictionary

func (*IntVectorValue) Duration added in v0.153.0

func (v *IntVectorValue) Duration() Duration

func (*IntVectorValue) ElementType added in v0.153.0

func (v *IntVectorValue) ElementType() semantic.MonoType

func (*IntVectorValue) Equal added in v0.153.0

func (v *IntVectorValue) Equal(other Value) bool

func (*IntVectorValue) Float added in v0.153.0

func (v *IntVectorValue) Float() float64

func (*IntVectorValue) Function added in v0.153.0

func (v *IntVectorValue) Function() Function

func (*IntVectorValue) Int added in v0.153.0

func (v *IntVectorValue) Int() int64

func (*IntVectorValue) IsNull added in v0.153.0

func (v *IntVectorValue) IsNull() bool

func (*IntVectorValue) Object added in v0.153.0

func (v *IntVectorValue) Object() Object

func (*IntVectorValue) Regexp added in v0.153.0

func (v *IntVectorValue) Regexp() *regexp.Regexp

func (*IntVectorValue) Release added in v0.153.0

func (v *IntVectorValue) Release()

func (*IntVectorValue) Retain added in v0.153.0

func (v *IntVectorValue) Retain()

func (*IntVectorValue) Str added in v0.153.0

func (v *IntVectorValue) Str() string

func (*IntVectorValue) Time added in v0.153.0

func (v *IntVectorValue) Time() Time

func (*IntVectorValue) Type added in v0.153.0

func (v *IntVectorValue) Type() semantic.MonoType

func (*IntVectorValue) UInt added in v0.153.0

func (v *IntVectorValue) UInt() uint64

func (*IntVectorValue) Vector added in v0.154.0

func (v *IntVectorValue) Vector() Vector

type Object

type Object interface {
	Value
	Get(name string) (Value, bool)

	// Set will set the object value for the given key.
	// The key must be part of the object property's type and the
	// value that is set must match that type. It is undefined
	// behavior to set a non-existant value or to set a value
	// with the wrong type.
	Set(name string, v Value)

	Len() int
	Range(func(name string, v Value))
}

func BuildObject added in v0.68.0

func BuildObject(fn func(set ObjectSetter) error) (Object, error)

BuildObject will build an object by setting key/value pairs. The records in the object get constructed in the order they are set and resetting a key will overwrite a previous value, but will retain the existing position.

func BuildObjectWithSize added in v0.68.0

func BuildObjectWithSize(sz int, fn func(set ObjectSetter) error) (Object, error)

BuildObjectWithSize will build an object with an initial size.

func NewObject

func NewObject(typ semantic.MonoType) Object

NewObject will create a new object with the given type. The type must be of kind Row. The new object will be uninitialized and must be constructed with Set on each of the property keys before it is used.

func NewObjectWithValues

func NewObjectWithValues(vals map[string]Value) Object

type ObjectSetter added in v0.68.0

type ObjectSetter func(k string, v Value)

ObjectSetter will set the value for the key. If the key already exists, it will be overwritten with the new value.

type Option added in v0.68.0

type Option struct {
	Value
}

Option is a value that has been declared as an option within the package. An option can be modified by another package from outside of the scope that the option was originally defined in, but it will affect the original scope it was defined in.

type Package added in v0.41.0

type Package interface {
	Object

	// Name returns the package name.
	Name() string

	// Path returns the canonical import path for this package.
	Path() string
}

type Scope added in v0.40.0

type Scope interface {
	// Lookup a name in the scope.
	Lookup(name string) (Value, bool)

	// LocalLookup a name in current scope only.
	LocalLookup(name string) (Value, bool)

	// Set binds a variable in the current scope.
	Set(name string, v Value)

	// Nest creates a new scope by nesting the current scope.
	// If the passed in object is not nil, its values will be added to the new nested scope.
	Nest(Object) Scope

	// Pop returns the parent of the current scope.
	Pop() Scope

	// Size is the number of visible names in scope.
	Size() int

	// Range iterates over all variable bindings in scope applying f.
	Range(f func(k string, v Value))

	// LocalRange iterates over all variable bindings only in the current scope.
	LocalRange(f func(k string, v Value))

	// SetReturn binds the return value of the scope.
	SetReturn(Value)

	// Return reports the bound return value of the scope.
	Return() Value

	// Copy creates a deep copy of the scope, values are not copied.
	// Copy preserves the nesting structure.
	Copy() Scope
}

func NewNestedScope added in v0.40.0

func NewNestedScope(parent Scope, obj Object) Scope

NewNestedScope creates a new scope with bindings from obj and a parent.

func NewScope added in v0.40.0

func NewScope() Scope

NewScope creates a new empty scope with no parent.

type StringVectorValue added in v0.153.0

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

func (*StringVectorValue) Arr added in v0.153.0

func (v *StringVectorValue) Arr() arrow.Array

func (*StringVectorValue) Array added in v0.153.0

func (v *StringVectorValue) Array() Array

func (*StringVectorValue) Bool added in v0.153.0

func (v *StringVectorValue) Bool() bool

func (*StringVectorValue) Bytes added in v0.153.0

func (v *StringVectorValue) Bytes() []byte

func (*StringVectorValue) Dict added in v0.153.0

func (v *StringVectorValue) Dict() Dictionary

func (*StringVectorValue) Duration added in v0.153.0

func (v *StringVectorValue) Duration() Duration

func (*StringVectorValue) ElementType added in v0.153.0

func (v *StringVectorValue) ElementType() semantic.MonoType

func (*StringVectorValue) Equal added in v0.153.0

func (v *StringVectorValue) Equal(other Value) bool

func (*StringVectorValue) Float added in v0.153.0

func (v *StringVectorValue) Float() float64

func (*StringVectorValue) Function added in v0.153.0

func (v *StringVectorValue) Function() Function

func (*StringVectorValue) Int added in v0.153.0

func (v *StringVectorValue) Int() int64

func (*StringVectorValue) IsNull added in v0.153.0

func (v *StringVectorValue) IsNull() bool

func (*StringVectorValue) Object added in v0.153.0

func (v *StringVectorValue) Object() Object

func (*StringVectorValue) Regexp added in v0.153.0

func (v *StringVectorValue) Regexp() *regexp.Regexp

func (*StringVectorValue) Release added in v0.153.0

func (v *StringVectorValue) Release()

func (*StringVectorValue) Retain added in v0.153.0

func (v *StringVectorValue) Retain()

func (*StringVectorValue) Str added in v0.153.0

func (v *StringVectorValue) Str() string

func (*StringVectorValue) Time added in v0.153.0

func (v *StringVectorValue) Time() Time

func (*StringVectorValue) Type added in v0.153.0

func (*StringVectorValue) UInt added in v0.153.0

func (v *StringVectorValue) UInt() uint64

func (*StringVectorValue) Vector added in v0.154.0

func (v *StringVectorValue) Vector() Vector

type Time

type Time int64

func ConvertTime

func ConvertTime(t time.Time) Time

func ParseTime

func ParseTime(s string) (Time, error)

func (Time) Add

func (t Time) Add(d Duration) Time

func (Time) Remainder added in v0.19.0

func (t Time) Remainder(d Duration) (r Duration)

Remainder divides t by d and returns the remainder.

func (Time) Round

func (t Time) Round(d Duration) Time

func (Time) String

func (t Time) String() string

func (Time) Sub added in v0.51.0

func (t Time) Sub(other Time) Duration

Sub takes another time and returns a duration giving the duration between the two times. A positive duration indicates that the receiver occurs after the other time.

func (Time) Time

func (t Time) Time() time.Time

type TimeVectorValue added in v0.154.0

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

func (*TimeVectorValue) Arr added in v0.154.0

func (v *TimeVectorValue) Arr() arrow.Array

func (*TimeVectorValue) Array added in v0.154.0

func (v *TimeVectorValue) Array() Array

func (*TimeVectorValue) Bool added in v0.154.0

func (v *TimeVectorValue) Bool() bool

func (*TimeVectorValue) Bytes added in v0.154.0

func (v *TimeVectorValue) Bytes() []byte

func (*TimeVectorValue) Dict added in v0.154.0

func (v *TimeVectorValue) Dict() Dictionary

func (*TimeVectorValue) Duration added in v0.154.0

func (v *TimeVectorValue) Duration() Duration

func (*TimeVectorValue) ElementType added in v0.154.0

func (v *TimeVectorValue) ElementType() semantic.MonoType

func (*TimeVectorValue) Equal added in v0.154.0

func (v *TimeVectorValue) Equal(other Value) bool

func (*TimeVectorValue) Float added in v0.154.0

func (v *TimeVectorValue) Float() float64

func (*TimeVectorValue) Function added in v0.154.0

func (v *TimeVectorValue) Function() Function

func (*TimeVectorValue) Int added in v0.154.0

func (v *TimeVectorValue) Int() int64

func (*TimeVectorValue) IsNull added in v0.154.0

func (v *TimeVectorValue) IsNull() bool

func (*TimeVectorValue) Object added in v0.154.0

func (v *TimeVectorValue) Object() Object

func (*TimeVectorValue) Regexp added in v0.154.0

func (v *TimeVectorValue) Regexp() *regexp.Regexp

func (*TimeVectorValue) Release added in v0.154.0

func (v *TimeVectorValue) Release()

func (*TimeVectorValue) Retain added in v0.154.0

func (v *TimeVectorValue) Retain()

func (*TimeVectorValue) Str added in v0.154.0

func (v *TimeVectorValue) Str() string

func (*TimeVectorValue) Time added in v0.154.0

func (v *TimeVectorValue) Time() Time

func (*TimeVectorValue) Type added in v0.154.0

func (v *TimeVectorValue) Type() semantic.MonoType

func (*TimeVectorValue) UInt added in v0.154.0

func (v *TimeVectorValue) UInt() uint64

func (*TimeVectorValue) Vector added in v0.154.0

func (v *TimeVectorValue) Vector() Vector

type Typer

type Typer interface {
	Type() semantic.MonoType
}

type UintVectorValue added in v0.153.0

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

func (*UintVectorValue) Arr added in v0.153.0

func (v *UintVectorValue) Arr() arrow.Array

func (*UintVectorValue) Array added in v0.153.0

func (v *UintVectorValue) Array() Array

func (*UintVectorValue) Bool added in v0.153.0

func (v *UintVectorValue) Bool() bool

func (*UintVectorValue) Bytes added in v0.153.0

func (v *UintVectorValue) Bytes() []byte

func (*UintVectorValue) Dict added in v0.153.0

func (v *UintVectorValue) Dict() Dictionary

func (*UintVectorValue) Duration added in v0.153.0

func (v *UintVectorValue) Duration() Duration

func (*UintVectorValue) ElementType added in v0.153.0

func (v *UintVectorValue) ElementType() semantic.MonoType

func (*UintVectorValue) Equal added in v0.153.0

func (v *UintVectorValue) Equal(other Value) bool

func (*UintVectorValue) Float added in v0.153.0

func (v *UintVectorValue) Float() float64

func (*UintVectorValue) Function added in v0.153.0

func (v *UintVectorValue) Function() Function

func (*UintVectorValue) Int added in v0.153.0

func (v *UintVectorValue) Int() int64

func (*UintVectorValue) IsNull added in v0.153.0

func (v *UintVectorValue) IsNull() bool

func (*UintVectorValue) Object added in v0.153.0

func (v *UintVectorValue) Object() Object

func (*UintVectorValue) Regexp added in v0.153.0

func (v *UintVectorValue) Regexp() *regexp.Regexp

func (*UintVectorValue) Release added in v0.153.0

func (v *UintVectorValue) Release()

func (*UintVectorValue) Retain added in v0.153.0

func (v *UintVectorValue) Retain()

func (*UintVectorValue) Str added in v0.153.0

func (v *UintVectorValue) Str() string

func (*UintVectorValue) Time added in v0.153.0

func (v *UintVectorValue) Time() Time

func (*UintVectorValue) Type added in v0.153.0

func (v *UintVectorValue) Type() semantic.MonoType

func (*UintVectorValue) UInt added in v0.153.0

func (v *UintVectorValue) UInt() uint64

func (*UintVectorValue) Vector added in v0.154.0

func (v *UintVectorValue) Vector() Vector

type Value

type Value interface {
	Typer
	IsNull() bool
	Str() string
	Bytes() []byte
	Int() int64
	UInt() uint64
	Float() float64
	Bool() bool
	Time() Time
	Duration() Duration
	Regexp() *regexp.Regexp
	Array() Array
	Object() Object
	Function() Function
	Dict() Dictionary
	Vector() Vector
	Equal(Value) bool

	Retain()
	Release()
}

func New

func New(v interface{}) Value

New constructs a new Value by inferring the type from the interface. Note this method will panic if passed a nil value. If the interface does not translate to a valid Value type, then InvalidValue is returned.

func NewBool

func NewBool(v bool) Value

func NewBytes added in v0.40.0

func NewBytes(v []byte) Value

func NewDuration

func NewDuration(v Duration) Value

func NewFloat

func NewFloat(v float64) Value

func NewInt

func NewInt(v int64) Value

func NewNull added in v0.14.0

func NewNull(t semantic.MonoType) Value

func NewRegexp

func NewRegexp(v *regexp.Regexp) Value

func NewString

func NewString(v string) Value

func NewTime

func NewTime(v Time) Value

func NewUInt

func NewUInt(v uint64) Value

func SetOption added in v0.68.0

func SetOption(p Package, name string, v Value) (Value, bool)

SetOption will set an option on the package and return the value representing the option.

func Stringify added in v0.109.0

func Stringify(v Value) (Value, error)

type Vector added in v0.153.0

type Vector interface {
	Value
	ElementType() semantic.MonoType
	Arr() arrow.Array
}

func NewBooleanVectorValue added in v0.153.0

func NewBooleanVectorValue(arr *arrow.Boolean) Vector

func NewFloatVectorValue added in v0.153.0

func NewFloatVectorValue(arr *arrow.Float) Vector

func NewIntVectorValue added in v0.153.0

func NewIntVectorValue(arr *arrow.Int) Vector

func NewStringVectorValue added in v0.153.0

func NewStringVectorValue(arr *arrow.String) Vector

func NewTimeVectorValue added in v0.154.0

func NewTimeVectorValue(arr *arrow.Int) Vector

func NewUintVectorValue added in v0.153.0

func NewUintVectorValue(arr *arrow.Uint) Vector

func NewVectorFromElements added in v0.153.0

func NewVectorFromElements(mem memory.Allocator, es ...interface{}) Vector

A convenience method for unit testing

func NewVectorValue added in v0.153.0

func NewVectorValue(arr arrow.Array, typ semantic.MonoType) Vector

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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