datavalues

package
v0.0.0-...-e6fb8a6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsBool

func AsBool(v IDataValue) bool

func AsFloat

func AsFloat(v IDataValue) float64

func AsInt

func AsInt(v IDataValue) int64

AsInt 转换为int类型

func AsInt32

func AsInt32(v IDataValue) int32

func AsString

func AsString(v IDataValue) string

func IsFloat

func IsFloat(v IDataValue) bool

func IsIntegral

func IsIntegral(v IDataValue) bool

func IsNumber

func IsNumber(v IDataValue) bool

func Like

func Like(likeExpr string, x IDataValue) bool

func LikeToRegexp

func LikeToRegexp(likeExpr string) *regexp.Regexp

Types

type Comparison

type Comparison int
const (
	LessThan    Comparison = -1
	Equal       Comparison = 0
	GreaterThan Comparison = 1
)

type Family

type Family int32
const (
	FamilyBool Family = iota
	FamilyInt
	FamilyFloat
	FamilyString
	FamilyTuple
)

type IDataValue

type IDataValue interface {
	Size() uintptr
	Type() Type
	Family() Family
	String() string
	Compare(value IDataValue) (Comparison, error)
	Document() docs.Documentation
}

func Add

func Add(v1 IDataValue, v2 IDataValue) (IDataValue, error)

func AsSlice

func AsSlice(v IDataValue) []IDataValue

func Div

func Div(v1 IDataValue, v2 IDataValue) (IDataValue, error)

func MakeBool

func MakeBool(v bool) IDataValue

func MakeFloat

func MakeFloat(v float64) IDataValue

func MakeInt

func MakeInt(v int64) IDataValue

func MakeInt32

func MakeInt32(v int32) IDataValue

func MakeString

func MakeString(v string) IDataValue

func MakeTuple

func MakeTuple(v ...IDataValue) IDataValue

func Max

func Max(v1 IDataValue, v2 IDataValue) (IDataValue, error)

func Min

func Min(v1 IDataValue, v2 IDataValue) (IDataValue, error)

func Mul

func Mul(v1 IDataValue, v2 IDataValue) (IDataValue, error)

func Sub

func Sub(v1 IDataValue, v2 IDataValue) (IDataValue, error)

func ToValue

func ToValue(value interface{}) IDataValue

NormalizeType brings various primitive types into the type we want them to be. All types coming out of data sources have to be already normalized this way.

func ZeroBool

func ZeroBool() IDataValue

func ZeroFloat

func ZeroFloat() IDataValue

func ZeroInt

func ZeroInt() IDataValue

func ZeroInt32

func ZeroInt32() IDataValue

func ZeroString

func ZeroString() IDataValue

func ZeroTuple

func ZeroTuple() IDataValue

type Type

type Type int
const (
	TypeZero Type = iota
	TypeNull
	TypePhantom
	TypeInt
	TypeInt32
	TypeFloat
	TypeBool
	TypeString
	TypeTime
	TypeDuration
	TypeTuple
	TypeObject
)

type ValueBool

type ValueBool bool

func (*ValueBool) AsBool

func (v *ValueBool) AsBool() bool

func (*ValueBool) Compare

func (v *ValueBool) Compare(other IDataValue) (Comparison, error)

func (*ValueBool) Document

func (v *ValueBool) Document() docs.Documentation

func (*ValueBool) Family

func (v *ValueBool) Family() Family

func (*ValueBool) Size

func (v *ValueBool) Size() uintptr

func (*ValueBool) String

func (v *ValueBool) String() string

func (*ValueBool) Type

func (v *ValueBool) Type() Type

type ValueFloat

type ValueFloat float64

func (*ValueFloat) AsFloat

func (v *ValueFloat) AsFloat() float64

func (*ValueFloat) Compare

func (v *ValueFloat) Compare(other IDataValue) (Comparison, error)

func (*ValueFloat) Document

func (v *ValueFloat) Document() docs.Documentation

func (*ValueFloat) Family

func (v *ValueFloat) Family() Family

func (*ValueFloat) Size

func (v *ValueFloat) Size() uintptr

func (*ValueFloat) String

func (v *ValueFloat) String() string

func (*ValueFloat) Type

func (v *ValueFloat) Type() Type

type ValueInt

type ValueInt int64

func (*ValueInt) AsInt

func (v *ValueInt) AsInt() int64

func (*ValueInt) Compare

func (v *ValueInt) Compare(other IDataValue) (Comparison, error)

func (*ValueInt) Document

func (v *ValueInt) Document() docs.Documentation

func (*ValueInt) Family

func (v *ValueInt) Family() Family

func (*ValueInt) Size

func (v *ValueInt) Size() uintptr

func (*ValueInt) String

func (v *ValueInt) String() string

func (*ValueInt) Type

func (v *ValueInt) Type() Type

type ValueInt32

type ValueInt32 int32

func (*ValueInt32) AsInt

func (v *ValueInt32) AsInt() int32

func (*ValueInt32) Compare

func (v *ValueInt32) Compare(other IDataValue) (Comparison, error)

func (*ValueInt32) Document

func (v *ValueInt32) Document() docs.Documentation

func (*ValueInt32) Family

func (v *ValueInt32) Family() Family

func (*ValueInt32) Size

func (v *ValueInt32) Size() uintptr

func (*ValueInt32) String

func (v *ValueInt32) String() string

func (*ValueInt32) Type

func (v *ValueInt32) Type() Type

type ValueString

type ValueString string

func (*ValueString) AsString

func (v *ValueString) AsString() string

func (*ValueString) Compare

func (v *ValueString) Compare(other IDataValue) (Comparison, error)

func (*ValueString) Document

func (v *ValueString) Document() docs.Documentation

func (*ValueString) Family

func (v *ValueString) Family() Family

func (*ValueString) Size

func (v *ValueString) Size() uintptr

func (*ValueString) String

func (v *ValueString) String() string

func (*ValueString) Type

func (v *ValueString) Type() Type

type ValueTuple

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

func (*ValueTuple) AsSlice

func (v *ValueTuple) AsSlice() []IDataValue

func (*ValueTuple) Compare

func (v *ValueTuple) Compare(other IDataValue) (Comparison, error)

func (*ValueTuple) Document

func (v *ValueTuple) Document() docs.Documentation

func (*ValueTuple) Family

func (v *ValueTuple) Family() Family

func (*ValueTuple) Size

func (v *ValueTuple) Size() uintptr

func (*ValueTuple) String

func (v *ValueTuple) String() string

func (*ValueTuple) Type

func (v *ValueTuple) Type() Type

Jump to

Keyboard shortcuts

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