value

package
v1.0.0-alpha.18 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolValue

type BoolValue bool

func NewBoolValue

func NewBoolValue(v bool) *BoolValue

func (*BoolValue) AsInterface

func (b *BoolValue) AsInterface() interface{}

func (*BoolValue) CompareTo

func (b *BoolValue) CompareTo(v Value) (int, error)

func (*BoolValue) String

func (b *BoolValue) String() string

type BytesValue

type BytesValue string

func NewBytesValue

func NewBytesValue(v []byte) *BytesValue

func (*BytesValue) AsInterface

func (s *BytesValue) AsInterface() interface{}

func (*BytesValue) CompareTo

func (s *BytesValue) CompareTo(v Value) (int, error)

func (*BytesValue) String

func (s *BytesValue) String() string

type Comparable

type Comparable interface {
	// CompareTo returns a value indicating the relationship between the receiver and the parameter.
	//
	// Returns a negative integer, zero, or a positive integer as the receiver is less than, equal
	// to, or greater than the parameter i.e. v1.CompareTo(v2) returns -1 if v1 < v2
	CompareTo(v Value) (int, error)
}

type DoubleValue

type DoubleValue float64

func NewDoubleValue

func NewDoubleValue(v float64) *DoubleValue

func (*DoubleValue) AsInterface

func (d *DoubleValue) AsInterface() interface{}

func (*DoubleValue) CompareTo

func (d *DoubleValue) CompareTo(v Value) (int, error)

func (*DoubleValue) String

func (d *DoubleValue) String() string

type IntValue

type IntValue int64

func NewIntValue

func NewIntValue(v int64) *IntValue

func (*IntValue) AsInterface

func (i *IntValue) AsInterface() interface{}

func (*IntValue) CompareTo

func (i *IntValue) CompareTo(v Value) (int, error)

func (*IntValue) String

func (i *IntValue) String() string

type StringValue

type StringValue string

func NewStringValue

func NewStringValue(v string) *StringValue

func (*StringValue) AsInterface

func (s *StringValue) AsInterface() interface{}

func (*StringValue) CompareTo

func (s *StringValue) CompareTo(v Value) (int, error)

func (*StringValue) String

func (s *StringValue) String() string

type Value

type Value interface {
	Comparable

	// AsInterface to return the value as interface
	AsInterface() interface{}
}

Value is our value object that implements comparable so that two values can be compared. This is used to build the keys(primary key or any other index key), or to build the selector filter. Note: if the field data type is byte/binary then the value object returned is base64 decoded. The reason is that JSON has encoded the byte array to base64 so to make sure we are using the user provided value in building the key and the filter we must first decode this field. This allows us later to perform prefix scans.

func NewValue

func NewValue(fieldType schema.FieldType, value []byte) (Value, error)

NewValue returns the value of the field from the raw json value. It uses schema to get the type of the field.

Jump to

Keyboard shortcuts

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