Documentation
¶
Index ¶
- Constants
- Variables
- func AreEqual(left, right Value) bool
- func MarshalObject(o map[string]Value) []byte
- func MonotonicMarshalBool(b bool) []byte
- func MonotonicMarshalDuration(d time.Duration) []byte
- func MonotonicMarshalFloat(f float64) []byte
- func MonotonicMarshalInt64(i int64) []byte
- func MonotonicMarshalNull() []byte
- func MonotonicMarshalPhantom() []byte
- func MonotonicMarshalString(s string) []byte
- func MonotonicMarshalTime(t time.Time) []byte
- func MonotonicMarshalTuple(vs []Value) []byte
- func MonotonicUnmarshalBool(b []byte) (bool, error)
- func MonotonicUnmarshalDuration(b []byte) (time.Duration, error)
- func MonotonicUnmarshalFloat(b []byte) (float64, error)
- func MonotonicUnmarshalInt64(b []byte) (int64, error)
- func MonotonicUnmarshalNull(b []byte) error
- func MonotonicUnmarshalPhantom(b []byte) error
- func MonotonicUnmarshalString(b []byte) (string, error)
- func MonotonicUnmarshalTime(b []byte) (time.Time, error)
- func UnmarshalObject(b []byte) (map[string]Value, error)
- func VariableNamesToStrings(vars []VariableName) []string
- type Comparison
- type Float
- type Int
- type Object
- func (*Object) Descriptor() ([]byte, []int)
- func (m *Object) GetFields() map[string]*Value
- func (*Object) ProtoMessage()
- func (m *Object) Reset()
- func (m *Object) String() string
- func (m *Object) XXX_DiscardUnknown()
- func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Object) XXX_Merge(src proto.Message)
- func (m *Object) XXX_Size() int
- func (m *Object) XXX_Unmarshal(b []byte) error
- type Phantom
- type Tuple
- func (*Tuple) Descriptor() ([]byte, []int)
- func (m *Tuple) GetFields() []*Value
- func (*Tuple) ProtoMessage()
- func (m *Tuple) Reset()
- func (m *Tuple) String() string
- func (m *Tuple) XXX_DiscardUnknown()
- func (m *Tuple) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Tuple) XXX_Merge(src proto.Message)
- func (m *Tuple) XXX_Size() int
- func (m *Tuple) XXX_Unmarshal(b []byte) error
- type Type
- type Value
- func GetPointersFromValues(values []Value) []*Value
- func GetValuesFromPointers(values []*Value) []Value
- func MakeBool(v bool) Value
- func MakeDuration(v time.Duration) Value
- func MakeFloat(v float64) Value
- func MakeInt(v int) Value
- func MakeNull() Value
- func MakeObject(v map[string]Value) Value
- func MakePhantom() Value
- func MakeString(v string) Value
- func MakeTime(v time.Time) Value
- func MakeTuple(v []Value) Value
- func MonotonicUnmarshalTuple(b []byte) ([]Value, error)
- func NormalizeType(value interface{}) Value
- func ZeroBool() Value
- func ZeroDuration() Value
- func ZeroFloat() Value
- func ZeroInt() Value
- func ZeroNull() Value
- func ZeroObject() Value
- func ZeroPhantom() Value
- func ZeroString() Value
- func ZeroTime() Value
- func ZeroTuple() Value
- func ZeroValue() Value
- func (v Value) AsBool() bool
- func (v Value) AsDuration() time.Duration
- func (v Value) AsFloat() float64
- func (v Value) AsInt() int
- func (v Value) AsMap() map[string]Value
- func (v Value) AsSlice() []Value
- func (v Value) AsString() string
- func (v Value) AsTime() time.Time
- func (*Value) Descriptor() ([]byte, []int)
- func (v Value) Document() docs.Documentation
- func (m *Value) GetBool() bool
- func (m *Value) GetDuration() *duration.Duration
- func (m *Value) GetFloat() float64
- func (m *Value) GetInt() int64
- func (m *Value) GetNull() bool
- func (m *Value) GetObject() *Object
- func (m *Value) GetPhantom() bool
- func (m *Value) GetString_() string
- func (m *Value) GetTime() *timestamp.Timestamp
- func (m *Value) GetTuple() *Tuple
- func (v Value) GetType() Type
- func (m *Value) GetValue() isValue_Value
- func (v *Value) MonotonicMarshal() []byte
- func (v *Value) MonotonicUnmarshal(bytes []byte) error
- func (*Value) ProtoMessage()
- func (m *Value) Reset()
- func (v *Value) ReversedMonotonicMarshal() []byte
- func (v Value) Show() string
- func (m *Value) String() string
- func (v Value) ToRawValue() interface{}
- func (m *Value) XXX_DiscardUnknown()
- func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Value) XXX_Merge(src proto.Message)
- func (*Value) XXX_OneofWrappers() []interface{}
- func (m *Value) XXX_Size() int
- func (m *Value) XXX_Unmarshal(b []byte) error
- type Value_Bool
- type Value_Duration
- type Value_Float
- type Value_Int
- type Value_Null
- type Value_Object
- type Value_Phantom
- type Value_String_
- type Value_Time
- type Value_Tuple
- type VariableName
- type Variables
Constants ¶
const ( NullIdentifier = 1 /* Nonexistent */ PhantomIdentifier = 2 /* Nonexistent */ IntIdentifier = 3 /* Number */ FloatIdentifier = 4 /* Number */ BoolIdentifier = 5 /* Bool */ StringIdentifier = 6 /* Until StringDelimiter */ TimestampIdentifier = 7 /* Number */ DurationIdentifier = 8 /* Number */ TupleIdentifier = 9 /* Until TupleDelimiter */ ObjectIdentifier = 10 /* Object is a tuple */ StringDelimiter = 11 TupleDelimiter = 12 )
Delimiters must be less than 128 and different from identifiers Identifiers must all be unique and less than 128
const ( NumberMarshalLength = 1 + 8 // b[0] = type, b[1:] = marshal BoolMarshalLength = 1 + 1 // b[0] = type, b[1] = 0/1 NonexistentMarshalLength = 1 // null and phantom )
const ( BYTE_OFFSET = 128 MinimalTupleLength = 1 + 1 + 1 // b[0] = type, b[1] = element, b[2] = end of tuple MinimalStringLength = 1 + 1 // b[0] = type, b[1] = end of string )
const StarExpressionName = "*star*"
Variables ¶
var ErrVariableNotFound = errors.New("variable not found")
Functions ¶
func AreEqual ¶
octosql.AreEqual checks the equality of the given values, returning false if the types don't match.
func MarshalObject ¶ added in v0.3.0
func MonotonicMarshalDuration ¶ added in v0.3.0
Marshal Duration
func MonotonicMarshalFloat ¶ added in v0.3.0
Marshal float Based on the code from https://github.com/danburkert/bytekey
func MonotonicMarshalInt64 ¶ added in v0.3.0
Marshal int and int64
func MonotonicMarshalPhantom ¶ added in v0.3.0
func MonotonicMarshalPhantom() []byte
Marshal phantom
func MonotonicMarshalString ¶ added in v0.3.0
Marshal string
func MonotonicMarshalTime ¶ added in v0.3.0
Marshal Timestamp
func MonotonicMarshalTuple ¶ added in v0.3.0
Marshal Tuple
func MonotonicUnmarshalBool ¶ added in v0.3.0
func MonotonicUnmarshalDuration ¶ added in v0.3.0
func MonotonicUnmarshalFloat ¶ added in v0.3.0
func MonotonicUnmarshalInt64 ¶ added in v0.3.0
func MonotonicUnmarshalNull ¶ added in v0.3.0
func MonotonicUnmarshalPhantom ¶ added in v0.3.0
func MonotonicUnmarshalString ¶ added in v0.3.0
func MonotonicUnmarshalTime ¶ added in v0.3.0
func VariableNamesToStrings ¶ added in v0.3.0
func VariableNamesToStrings(vars []VariableName) []string
Types ¶
type Comparison ¶ added in v0.3.0
type Comparison int
const ( LessThan Comparison = -1 Equal Comparison = 0 GreaterThan Comparison = 1 )
func Compare ¶ added in v0.3.0
func Compare(x, y Value) (Comparison, error)
type Object ¶
type Object struct {
Fields map[string]*Value `` /* 153-byte string literal not displayed */
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Object) Descriptor ¶ added in v0.3.0
func (*Object) ProtoMessage ¶ added in v0.3.0
func (*Object) ProtoMessage()
func (*Object) XXX_DiscardUnknown ¶ added in v0.3.0
func (m *Object) XXX_DiscardUnknown()
func (*Object) XXX_Marshal ¶ added in v0.3.0
func (*Object) XXX_Unmarshal ¶ added in v0.3.0
type Tuple ¶
type Tuple struct {
Fields []*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Tuple) Descriptor ¶ added in v0.3.0
func (*Tuple) ProtoMessage ¶ added in v0.3.0
func (*Tuple) ProtoMessage()
func (*Tuple) XXX_DiscardUnknown ¶ added in v0.3.0
func (m *Tuple) XXX_DiscardUnknown()
func (*Tuple) XXX_Marshal ¶ added in v0.3.0
func (*Tuple) XXX_Unmarshal ¶ added in v0.3.0
type Value ¶
type Value struct {
// Types that are valid to be assigned to Value:
// *Value_Null
// *Value_Phantom
// *Value_Int
// *Value_Float
// *Value_Bool
// *Value_String_
// *Value_Time
// *Value_Duration
// *Value_Tuple
// *Value_Object
Value isValue_Value `protobuf_oneof:"value"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func GetPointersFromValues ¶ added in v0.3.0
func GetValuesFromPointers ¶ added in v0.3.0
func MakeDuration ¶
func MakeObject ¶
func MakePhantom ¶
func MakePhantom() Value
func MakeString ¶
func MonotonicUnmarshalTuple ¶ added in v0.3.0
func NormalizeType ¶
func NormalizeType(value interface{}) Value
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 ZeroDuration ¶
func ZeroDuration() Value
func ZeroObject ¶
func ZeroObject() Value
func ZeroPhantom ¶
func ZeroPhantom() Value
func ZeroString ¶
func ZeroString() Value
func (Value) AsDuration ¶ added in v0.3.0
func (*Value) Descriptor ¶ added in v0.3.0
func (Value) Document ¶ added in v0.3.0
func (v Value) Document() docs.Documentation
func (*Value) GetDuration ¶ added in v0.3.0
func (*Value) GetPhantom ¶ added in v0.3.0
func (*Value) GetString_ ¶ added in v0.3.0
func (Value) GetType ¶ added in v0.3.0
Można na tych Value pod spodem zdefiniowac GetType i użyć wirtualnych metod, a nie type switch
func (*Value) MonotonicMarshal ¶ added in v0.3.0
func (*Value) MonotonicUnmarshal ¶ added in v0.3.0
func (*Value) ProtoMessage ¶ added in v0.3.0
func (*Value) ProtoMessage()
func (*Value) ReversedMonotonicMarshal ¶ added in v0.3.0
monotonically decreasing version of MonotonicMarshal
func (Value) ToRawValue ¶ added in v0.3.0
func (v Value) ToRawValue() interface{}
func (*Value) XXX_DiscardUnknown ¶ added in v0.3.0
func (m *Value) XXX_DiscardUnknown()
func (*Value) XXX_Marshal ¶ added in v0.3.0
func (*Value) XXX_OneofWrappers ¶ added in v0.3.0
func (*Value) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Value) XXX_Unmarshal ¶ added in v0.3.0
type Value_Bool ¶ added in v0.3.0
type Value_Bool struct {
Bool bool `protobuf:"varint,5,opt,name=bool,proto3,oneof"`
}
type Value_Duration ¶ added in v0.3.0
type Value_Float ¶ added in v0.3.0
type Value_Float struct {
Float float64 `protobuf:"fixed64,4,opt,name=float,proto3,oneof"`
}
type Value_Int ¶ added in v0.3.0
type Value_Int struct {
Int int64 `protobuf:"varint,3,opt,name=int,proto3,oneof"`
}
type Value_Null ¶ added in v0.3.0
type Value_Null struct {
Null bool `protobuf:"varint,1,opt,name=null,proto3,oneof"`
}
type Value_Object ¶ added in v0.3.0
type Value_Object struct {
Object *Object `protobuf:"bytes,10,opt,name=object,proto3,oneof"`
}
type Value_Phantom ¶ added in v0.3.0
type Value_Phantom struct {
Phantom bool `protobuf:"varint,2,opt,name=phantom,proto3,oneof"`
}
type Value_String_ ¶ added in v0.3.0
type Value_String_ struct {
String_ string `protobuf:"bytes,6,opt,name=string,proto3,oneof"`
}
type Value_Time ¶ added in v0.3.0
type Value_Tuple ¶ added in v0.3.0
type Value_Tuple struct {
Tuple *Tuple `protobuf:"bytes,9,opt,name=tuple,proto3,oneof"`
}
type VariableName ¶
type VariableName string
func NewVariableName ¶
func NewVariableName(varname string) VariableName
func StringsToVariableNames ¶ added in v0.3.0
func StringsToVariableNames(strings []string) []VariableName
func (VariableName) Empty ¶ added in v0.3.0
func (vn VariableName) Empty() bool
func (VariableName) Equal ¶ added in v0.3.0
func (vn VariableName) Equal(other VariableName) bool
func (VariableName) Name ¶
func (vn VariableName) Name() string
func (VariableName) Source ¶
func (vn VariableName) Source() string
func (VariableName) String ¶
func (vn VariableName) String() string
type Variables ¶
type Variables map[VariableName]Value
func NewVariables ¶
func NewVariables(variables map[VariableName]Value) Variables
func NoVariables ¶
func NoVariables() Variables
func (Variables) DeterministicOrder ¶ added in v0.3.0
func (vs Variables) DeterministicOrder() []VariableName
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
octosql
command
|
|
|
datasources
|
|
|
aggregates/docgen
command
|
|
|
functions/docgen
command
|
|
|
trigger/docgen
command
|
|
|
tvf/docgen
command
|
|
|
sqlparser/dependency/hack
Package hack gives you some efficient functionality at the cost of breaking some Go rules.
|
Package hack gives you some efficient functionality at the cost of breaking some Go rules. |
|
sqlparser/dependency/query
Package query is a generated protocol buffer package.
|
Package query is a generated protocol buffer package. |
|
sqlparser/dependency/sqltypes
Package sqltypes implements interfaces and types that represent SQL values.
|
Package sqltypes implements interfaces and types that represent SQL values. |

