Documentation
¶
Overview ¶
Package values declares the flux data types and implements them.
Index ¶
- Variables
- func CheckKind(got, exp semantic.Kind)
- func NewObject() *object
- func UnexpectedKind(got, exp semantic.Kind) error
- type Array
- type BinaryFuncSignature
- type BinaryFunction
- type Duration
- type Function
- type Object
- type Time
- type Typer
- type Value
- func NewBoolValue(v bool) Value
- func NewDurationValue(v Duration) Value
- func NewFloatValue(v float64) Value
- func NewIntValue(v int64) Value
- func NewRegexpValue(v *regexp.Regexp) Value
- func NewStringValue(v string) Value
- func NewTimeValue(v Time) Value
- func NewUIntValue(v uint64) Value
- func NewValue(v interface{}, k semantic.Kind) (Value, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidValue = value{/* contains filtered or unexported fields */}
InvalidValue is a non nil value who's type is semantic.Invalid
Functions ¶
func UnexpectedKind ¶
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
type BinaryFuncSignature ¶
type BinaryFuncSignature struct {
Operator ast.OperatorKind
Left, Right semantic.Type
}
type BinaryFunction ¶
func LookupBinaryFunction ¶
func LookupBinaryFunction(sig BinaryFuncSignature) (BinaryFunction, error)
type Value ¶
type Value interface {
Typer
Str() string
Int() int64
UInt() uint64
Float() float64
Bool() bool
Time() Time
Duration() Duration
Regexp() *regexp.Regexp
Array() Array
Object() Object
Function() Function
Equal(Value) bool
}
func NewBoolValue ¶
func NewDurationValue ¶
func NewFloatValue ¶
func NewIntValue ¶
func NewRegexpValue ¶
func NewStringValue ¶
func NewTimeValue ¶
func NewUIntValue ¶
Click to show internal directories.
Click to hide internal directories.