value

package
v0.0.0-...-9ff550a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeOutputFormat = "00:00:00"

	DataOutputFormat = "0000-00-00"

	TimestampOutputFormat = "2006-01-02 15:04:05"
)

time.Time formats.

Variables

View Source
var (
	ConstTrue  Bool = true
	ConstFalse Bool = false
	ConstNull  Null = Null{}
)

Functions

func CompareBool

func CompareBool(d, v bool) int

CompareBool compare the input bools according to the SQL comparison rules.

func MustBeBool

func MustBeBool(v interface{}) bool

func MustBeFloat

func MustBeFloat(v interface{}) float64

func MustBeFloat32

func MustBeFloat32(v interface{}) float32

func MustBeFloat64

func MustBeFloat64(v interface{}) float64

func MustBeInt

func MustBeInt(v interface{}) int64

func MustBeInt16

func MustBeInt16(v interface{}) int16

func MustBeInt32

func MustBeInt32(v interface{}) int32

func MustBeInt64

func MustBeInt64(v interface{}) int64

func MustBeInt8

func MustBeInt8(v interface{}) int8

func MustBeString

func MustBeString(v interface{}) string

func MustBeTimestamp

func MustBeTimestamp(v interface{}) time.Time

func MustBeUint16

func MustBeUint16(v interface{}) uint16

func MustBeUint32

func MustBeUint32(v interface{}) uint32

func MustBeUint64

func MustBeUint64(v interface{}) uint64

func MustBeUint8

func MustBeUint8(v interface{}) uint8

Types

type Array

type Array []Value

func (Array) Eval

func (a Array) Eval(mp map[string]Values) (Values, uint32, error)

Not yet supported

type Bool

type Bool bool // true = 1, false = 0

func NewBool

func NewBool(v bool) *Bool

func ParseBool

func ParseBool(s string) (*Bool, error)

func (*Bool) Attributes

func (_ *Bool) Attributes() []string

func (*Bool) Compare

func (a *Bool) Compare(v Value) int

func (*Bool) Eval

func (a *Bool) Eval(mp map[string]Values) (Values, uint32, error)

func (*Bool) IsAndOnly

func (_ *Bool) IsAndOnly() bool

func (*Bool) IsLogical

func (_ *Bool) IsLogical() bool

func (*Bool) ResolvedType

func (_ *Bool) ResolvedType() types.T

func (*Bool) ReturnType

func (a *Bool) ReturnType() uint32

func (*Bool) Size

func (_ *Bool) Size() int

func (*Bool) String

func (a *Bool) String() string

func (*Bool) ToValues

func (a *Bool) ToValues() Values

type Data

type Data uint32

type Float

type Float float64

func NewFloat

func NewFloat(v float64) *Float

func ParseFloat

func ParseFloat(s string) (*Float, error)

ParseFloat parses and returns the *Float value represented by the provided string, or an error if parsing is unsuccessful.

func (*Float) Attributes

func (_ *Float) Attributes() []string

func (*Float) Compare

func (a *Float) Compare(v Value) int

func (*Float) Eval

func (a *Float) Eval(mp map[string]Values) (Values, uint32, error)

func (*Float) IsAndOnly

func (_ *Float) IsAndOnly() bool

func (*Float) IsLogical

func (_ *Float) IsLogical() bool

func (*Float) ResolvedType

func (_ *Float) ResolvedType() types.T

func (*Float) ReturnType

func (a *Float) ReturnType() uint32

func (*Float) Size

func (_ *Float) Size() int

func (*Float) String

func (a *Float) String() string

func (*Float) ToValues

func (a *Float) ToValues() Values

type Float32

type Float32 float32

func NewFloat32

func NewFloat32(v float32) *Float32

func ParseFloat32

func ParseFloat32(s string) (*Float32, error)

ParseFloat32 parses and returns the *Float32 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Float32) Attributes

func (_ *Float32) Attributes() []string

func (*Float32) Compare

func (a *Float32) Compare(v Value) int

func (*Float32) Eval

func (a *Float32) Eval(mp map[string]Values) (Values, uint32, error)

func (*Float32) IsAndOnly

func (_ *Float32) IsAndOnly() bool

func (*Float32) IsLogical

func (_ *Float32) IsLogical() bool

func (*Float32) ResolvedType

func (_ *Float32) ResolvedType() types.T

func (*Float32) ReturnType

func (a *Float32) ReturnType() uint32

func (*Float32) Size

func (_ *Float32) Size() int

func (*Float32) String

func (a *Float32) String() string

func (*Float32) ToValues

func (a *Float32) ToValues() Values

type Float64

type Float64 float64

func NewFloat64

func NewFloat64(v float64) *Float64

func ParseFloat64

func ParseFloat64(s string) (*Float64, error)

ParseFloat64 parses and returns the *Float64 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Float64) Attributes

func (_ *Float64) Attributes() []string

func (*Float64) Compare

func (a *Float64) Compare(v Value) int

func (*Float64) Eval

func (a *Float64) Eval(mp map[string]Values) (Values, uint32, error)

func (*Float64) IsAndOnly

func (_ *Float64) IsAndOnly() bool

func (*Float64) IsLogical

func (_ *Float64) IsLogical() bool

func (*Float64) ResolvedType

func (_ *Float64) ResolvedType() types.T

func (*Float64) ReturnType

func (a *Float64) ReturnType() uint32

func (*Float64) Size

func (_ *Float64) Size() int

func (*Float64) String

func (a *Float64) String() string

func (*Float64) ToValues

func (a *Float64) ToValues() Values

type Int

type Int int64

func NewInt

func NewInt(v int64) *Int

func ParseInt

func ParseInt(s string) (*Int, error)

ParseInt parses and returns the *Int value represented by the provided string, or an error if parsing is unsuccessful.

func (*Int) Attributes

func (_ *Int) Attributes() []string

func (*Int) Compare

func (a *Int) Compare(v Value) int

func (*Int) Eval

func (a *Int) Eval(mp map[string]Values) (Values, uint32, error)

func (*Int) IsAndOnly

func (_ *Int) IsAndOnly() bool

func (*Int) IsLogical

func (_ *Int) IsLogical() bool

func (*Int) ResolvedType

func (_ *Int) ResolvedType() types.T

func (*Int) ReturnType

func (a *Int) ReturnType() uint32

func (*Int) Size

func (_ *Int) Size() int

func (*Int) String

func (a *Int) String() string

func (*Int) ToValues

func (a *Int) ToValues() Values

type Int16

type Int16 int16

func NewInt16

func NewInt16(v int16) *Int16

func ParseInt16

func ParseInt16(s string) (*Int16, error)

ParseInt16 parses and returns the *Int16 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Int16) Attributes

func (_ *Int16) Attributes() []string

func (*Int16) Compare

func (a *Int16) Compare(v Value) int

func (*Int16) Eval

func (a *Int16) Eval(mp map[string]Values) (Values, uint32, error)

func (*Int16) IsAndOnly

func (_ *Int16) IsAndOnly() bool

func (*Int16) IsLogical

func (_ *Int16) IsLogical() bool

func (*Int16) ResolvedType

func (_ *Int16) ResolvedType() types.T

func (*Int16) ReturnType

func (a *Int16) ReturnType() uint32

func (*Int16) Size

func (_ *Int16) Size() int

func (*Int16) String

func (a *Int16) String() string

func (*Int16) ToValues

func (a *Int16) ToValues() Values

type Int32

type Int32 int32

func NewInt32

func NewInt32(v int32) *Int32

func ParseInt32

func ParseInt32(s string) (*Int32, error)

ParseInt32 parses and returns the *Int32 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Int32) Attributes

func (_ *Int32) Attributes() []string

func (*Int32) Compare

func (a *Int32) Compare(v Value) int

func (*Int32) Eval

func (a *Int32) Eval(mp map[string]Values) (Values, uint32, error)

func (*Int32) IsAndOnly

func (_ *Int32) IsAndOnly() bool

func (*Int32) IsLogical

func (_ *Int32) IsLogical() bool

func (*Int32) ResolvedType

func (_ *Int32) ResolvedType() types.T

func (*Int32) ReturnType

func (a *Int32) ReturnType() uint32

func (*Int32) Size

func (_ *Int32) Size() int

func (*Int32) String

func (a *Int32) String() string

func (*Int32) ToValues

func (a *Int32) ToValues() Values

type Int64

type Int64 int64

func NewInt64

func NewInt64(v int64) *Int64

func ParseInt64

func ParseInt64(s string) (*Int64, error)

ParseInt64 parses and returns the *Int64 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Int64) Attributes

func (_ *Int64) Attributes() []string

func (*Int64) Compare

func (a *Int64) Compare(v Value) int

func (*Int64) Eval

func (a *Int64) Eval(mp map[string]Values) (Values, uint32, error)

func (*Int64) IsAndOnly

func (_ *Int64) IsAndOnly() bool

func (*Int64) IsLogical

func (_ *Int64) IsLogical() bool

func (*Int64) ResolvedType

func (_ *Int64) ResolvedType() types.T

func (*Int64) ReturnType

func (a *Int64) ReturnType() uint32

func (*Int64) Size

func (_ *Int64) Size() int

func (*Int64) String

func (a *Int64) String() string

func (*Int64) ToValues

func (a *Int64) ToValues() Values

type Int8

type Int8 int8

func NewInt8

func NewInt8(v int8) *Int8

func ParseInt8

func ParseInt8(s string) (*Int8, error)

ParseInt8 parses and returns the *Int8 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Int8) Attributes

func (_ *Int8) Attributes() []string

func (*Int8) Compare

func (a *Int8) Compare(v Value) int

func (*Int8) Eval

func (a *Int8) Eval(mp map[string]Values) (Values, uint32, error)

func (*Int8) IsAndOnly

func (_ *Int8) IsAndOnly() bool

func (*Int8) IsLogical

func (_ *Int8) IsLogical() bool

func (*Int8) ResolvedType

func (_ *Int8) ResolvedType() types.T

func (*Int8) ReturnType

func (a *Int8) ReturnType() uint32

func (*Int8) Size

func (_ *Int8) Size() int

func (*Int8) String

func (a *Int8) String() string

func (*Int8) ToValues

func (a *Int8) ToValues() Values

type Null

type Null struct{}

func (Null) Attributes

func (_ Null) Attributes() []string

func (Null) Compare

func (_ Null) Compare(v Value) int

func (Null) Eval

func (a Null) Eval(_ map[string]Values) (Values, uint32, error)

func (Null) IsAndOnly

func (_ Null) IsAndOnly() bool

func (Null) IsLogical

func (_ Null) IsLogical() bool

func (Null) ResolvedType

func (_ Null) ResolvedType() types.T

func (Null) ReturnType

func (_ Null) ReturnType() uint32

func (Null) Size

func (_ Null) Size() int

func (Null) String

func (_ Null) String() string

type String

type String string

func NewString

func NewString(v string) *String

func (*String) Attributes

func (_ *String) Attributes() []string

func (*String) Compare

func (a *String) Compare(v Value) int

func (*String) Eval

func (a *String) Eval(mp map[string]Values) (Values, uint32, error)

func (*String) IsAndOnly

func (_ *String) IsAndOnly() bool

func (*String) IsLogical

func (_ *String) IsLogical() bool

func (*String) ResolvedType

func (_ *String) ResolvedType() types.T

func (*String) ReturnType

func (a *String) ReturnType() uint32

func (*String) Size

func (a *String) Size() int

func (*String) String

func (a *String) String() string

func (*String) ToValues

func (a *String) ToValues() Values

type Time

type Time uint32 // 0 ~ 24 * 3600

type Timestamp

type Timestamp int64

func NewTimestamp

func NewTimestamp(v time.Time) *Timestamp

func ParseTimestamp

func ParseTimestamp(s string) (*Timestamp, error)

ParseTimestamp parses and returns the *Timestamp value represented by the provided string in UTC, or an error if parsing is unsuccessful.

func (*Timestamp) Attributes

func (_ *Timestamp) Attributes() []string

func (*Timestamp) Compare

func (a *Timestamp) Compare(v Value) int

func (*Timestamp) Eval

func (a *Timestamp) Eval(mp map[string]Values) (Values, uint32, error)

func (*Timestamp) IsAndOnly

func (_ *Timestamp) IsAndOnly() bool

func (*Timestamp) IsLogical

func (_ *Timestamp) IsLogical() bool

func (*Timestamp) ResolvedType

func (_ *Timestamp) ResolvedType() types.T

func (*Timestamp) ReturnType

func (a *Timestamp) ReturnType() uint32

func (*Timestamp) Size

func (_ *Timestamp) Size() int

func (*Timestamp) String

func (a *Timestamp) String() string

func (*Timestamp) ToValues

func (a *Timestamp) ToValues() Values

type Uint16

type Uint16 uint16

func NewUint16

func NewUint16(v uint16) *Uint16

func ParseUint16

func ParseUint16(s string) (*Uint16, error)

ParseUint16 parses and returns the *Uint16 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Uint16) Attributes

func (_ *Uint16) Attributes() []string

func (*Uint16) Compare

func (a *Uint16) Compare(v Value) int

func (*Uint16) Eval

func (a *Uint16) Eval(mp map[string]Values) (Values, uint32, error)

func (*Uint16) IsAndOnly

func (_ *Uint16) IsAndOnly() bool

func (*Uint16) IsLogical

func (_ *Uint16) IsLogical() bool

func (*Uint16) ResolvedType

func (_ *Uint16) ResolvedType() types.T

func (*Uint16) ReturnType

func (a *Uint16) ReturnType() uint32

func (*Uint16) Size

func (_ *Uint16) Size() int

func (*Uint16) String

func (a *Uint16) String() string

func (*Uint16) ToValues

func (a *Uint16) ToValues() Values

type Uint32

type Uint32 uint32

func NewUint32

func NewUint32(v uint32) *Uint32

func ParseUint32

func ParseUint32(s string) (*Uint32, error)

ParseUint32 parses and returns the *Uint32 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Uint32) Attributes

func (_ *Uint32) Attributes() []string

func (*Uint32) Compare

func (a *Uint32) Compare(v Value) int

func (*Uint32) Eval

func (a *Uint32) Eval(mp map[string]Values) (Values, uint32, error)

func (*Uint32) IsAndOnly

func (_ *Uint32) IsAndOnly() bool

func (*Uint32) IsLogical

func (_ *Uint32) IsLogical() bool

func (*Uint32) ResolvedType

func (_ *Uint32) ResolvedType() types.T

func (*Uint32) ReturnType

func (a *Uint32) ReturnType() uint32

func (*Uint32) Size

func (_ *Uint32) Size() int

func (*Uint32) String

func (a *Uint32) String() string

func (*Uint32) ToValues

func (a *Uint32) ToValues() Values

type Uint64

type Uint64 uint64

func NewUint64

func NewUint64(v uint64) *Uint64

func ParseUint64

func ParseUint64(s string) (*Uint64, error)

ParseUint64 parses and returns the *Uint64 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Uint64) Attributes

func (_ *Uint64) Attributes() []string

func (*Uint64) Compare

func (a *Uint64) Compare(v Value) int

func (*Uint64) Eval

func (a *Uint64) Eval(mp map[string]Values) (Values, uint32, error)

func (*Uint64) IsAndOnly

func (_ *Uint64) IsAndOnly() bool

func (*Uint64) IsLogical

func (_ *Uint64) IsLogical() bool

func (*Uint64) ResolvedType

func (_ *Uint64) ResolvedType() types.T

func (*Uint64) ReturnType

func (a *Uint64) ReturnType() uint32

func (*Uint64) Size

func (_ *Uint64) Size() int

func (*Uint64) String

func (a *Uint64) String() string

func (*Uint64) ToValues

func (a *Uint64) ToValues() Values

type Uint8

type Uint8 uint8

func NewUint8

func NewUint8(v uint8) *Uint8

func ParseUint8

func ParseUint8(s string) (*Uint8, error)

ParseUint8 parses and returns the *Uint8 value represented by the provided string, or an error if parsing is unsuccessful.

func (*Uint8) Attributes

func (_ *Uint8) Attributes() []string

func (*Uint8) Compare

func (a *Uint8) Compare(v Value) int

func (*Uint8) Eval

func (a *Uint8) Eval(mp map[string]Values) (Values, uint32, error)

func (*Uint8) IsAndOnly

func (_ *Uint8) IsAndOnly() bool

func (*Uint8) IsLogical

func (_ *Uint8) IsLogical() bool

func (*Uint8) ResolvedType

func (_ *Uint8) ResolvedType() types.T

func (*Uint8) ReturnType

func (a *Uint8) ReturnType() uint32

func (*Uint8) Size

func (_ *Uint8) Size() int

func (*Uint8) String

func (a *Uint8) String() string

func (*Uint8) ToValues

func (a *Uint8) ToValues() Values

type Value

type Value interface {
	Size() int

	String() string
	Compare(Value) int
	ResolvedType() types.T

	IsLogical() bool
	IsAndOnly() bool
	ReturnType() uint32
	Attributes() []string
	Eval(map[string]Values) (Values, uint32, error)
}

type Values

type Values interface {
	Size() int

	Show() ([]byte, error)
	Read(int, []byte) error

	Count() int
	Slice() ([]uint64, [][]byte)

	Filter([]uint64) interface{}
	MergeFilter(interface{}) interface{}

	MarkNull(int) error
	Append(interface{}) error
	Update([]int, interface{}) error
	Merge(*roaring.Bitmap, *roaring.Bitmap) error
}

func NewValues

func NewValues(v interface{}) Values

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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