Documentation ¶
Index ¶
- Variables
- func BigEndianUint128(hi, lo uint64) (v [16]byte)
- func Compare(l, r V) (int, error)
- func DurationFromMicroseconds(n int64) time.Duration
- func DurationToMicroseconds(d time.Duration) int64
- func MarshalDate(t time.Time) uint32
- func MarshalDatetime(t time.Time) uint32
- func MarshalTimestamp(t time.Time) uint64
- func MarshalTzDate(t time.Time) string
- func MarshalTzDatetime(t time.Time) string
- func MarshalTzTimestamp(t time.Time) string
- func PrimitiveFromYDB(x *Ydb.Value) (v interface{})
- func TypeToYDB(t T) *Ydb.Type
- func TypesEqual(a, b T) bool
- func UnmarshalDate(n uint32) time.Time
- func UnmarshalDatetime(n uint32) time.Time
- func UnmarshalTimestamp(n uint64) time.Time
- func UnmarshalTzDate(s string) (time.Time, error)
- func UnmarshalTzDatetime(s string) (time.Time, error)
- func UnmarshalTzTimestamp(s string) (time.Time, error)
- func ValueToYDB(v V) *Ydb.TypedValue
- func WriteTypeStringTo(buf *bytes.Buffer, t T)
- func WriteValueStringTo(buf *bytes.Buffer, v V)
- type DecimalType
- type DictType
- type FeatureFlag
- type ListType
- type NoOpResponse
- type OpResponse
- type Operation
- type OptionalType
- type PrimitiveType
- type Response
- type StreamOperation
- type StreamOperationResponse
- type StructField
- type StructType
- type StructValueProto
- type T
- type TupleType
- type V
- type Value
- func BoolValue(v bool) Value
- func DateValue(v uint32) Value
- func DatetimeValue(v uint32) Value
- func DecimalValue(t T, v [16]byte) Value
- func DictValue(n int, it func(int) V) Value
- func DoubleValue(v float64) Value
- func DyNumberValue(v string) Value
- func FloatValue(v float32) Value
- func Int16Value(v int16) Value
- func Int32Value(v int32) Value
- func Int64Value(v int64) Value
- func Int8Value(v int8) Value
- func IntervalValue(v int64) Value
- func JSONDocumentValue(v string) Value
- func JSONValue(v string) Value
- func ListValue(n int, it func(int) V) Value
- func NullValue(t T) Value
- func OptionalValue(v V) Value
- func StringValue(v []byte) Value
- func StructValue(p *StructValueProto) Value
- func TimestampValue(v uint64) Value
- func TupleValue(n int, it func(int) V) Value
- func TzDateValue(v string) Value
- func TzDatetimeValue(v string) Value
- func TzTimestampValue(v string) Value
- func UTF8Value(v string) Value
- func UUIDValue(v [16]byte) Value
- func Uint16Value(v uint16) Value
- func Uint32Value(v uint32) Value
- func Uint64Value(v uint64) Value
- func Uint8Value(v uint8) Value
- func VariantValue(x V, i uint32, t T) Value
- func YSONValue(v string) Value
- func ZeroValue(t T) Value
- type VariantType
- type VoidType
Constants ¶
This section is empty.
Variables ¶
var VoidValue = Value{ // contains filtered or unexported fields }
Functions ¶
func BigEndianUint128 ¶
BigEndianUint128 builds a big-endian uint128 value.
func Compare ¶
Compare compares its operands. It returns -1, 0, 1 if l < r, l == r, l > r. Returns error if types are not comparable. Comparable types are all integer types, UUID, DyNumber, Float, Double, String, UTF8, Date, Datetime, Timestamp, Tuples and Lists. Primitive arguments are comparable if their types are the same. Optional type is comparable to underlying type, e.g. Optional<Optional<Float>> is comparable to Float. Null value is comparable to non-null value of the same type and is considered less than any non-null value. Tuples and Lists are comparable if their elements are comparable. Tuples and Lists are compared lexicographically. If tuples (lists) have different length and elements of the shorter tuple (list) are all equal to corresponding elements of the other tuple (list), than the shorter tuple (list) is considered less than the longer one.
func DurationFromMicroseconds ¶ added in v2.12.1
func DurationToMicroseconds ¶ added in v2.12.1
func MarshalDate ¶
func MarshalDatetime ¶
func MarshalTimestamp ¶
func MarshalTzDate ¶
func MarshalTzDatetime ¶
func MarshalTzTimestamp ¶
func PrimitiveFromYDB ¶
PrimitiveFromYDB returns a primitive value stored in x. Currently it may return one of this types:
bool int32 uint32 int64 uint64 float32 float64 []byte string [16]byte
Or nil.
func TypesEqual ¶
func UnmarshalDate ¶
Up to 11761191-01-20 00:00:00 +0000 UTC.
func UnmarshalDatetime ¶
Up to 2106-02-07 06:28:15 +0000 UTC.
func UnmarshalTimestamp ¶
Up to 586524-01-19 08:01:49.000551615 +0000 UTC.
func ValueToYDB ¶
func ValueToYDB(v V) *Ydb.TypedValue
func WriteTypeStringTo ¶
func WriteValueStringTo ¶
Types ¶
type DecimalType ¶
func (DecimalType) String ¶
func (d DecimalType) String() string
type FeatureFlag ¶
type FeatureFlag int
const ( FeatureUnknown FeatureFlag = iota FeatureEnabled FeatureDisabled )
func FeatureFlagFromYDB ¶
func FeatureFlagFromYDB(f Ydb.FeatureFlag_Status) FeatureFlag
func (FeatureFlag) ToYDB ¶
func (f FeatureFlag) ToYDB() Ydb.FeatureFlag_Status
type NoOpResponse ¶
type NoOpResponse interface { proto.Message GetStatus() Ydb.StatusIds_StatusCode GetIssues() []*Ydb_Issue.IssueMessage }
type OpResponse ¶
type OpResponse interface { proto.Message GetOperation() *Ydb_Operations.Operation }
type OptionalType ¶
type OptionalType struct {
T T
}
func (OptionalType) String ¶
func (opt OptionalType) String() string
type PrimitiveType ¶
type PrimitiveType int
const ( TypeUnknown PrimitiveType = iota TypeBool TypeInt8 TypeUint8 TypeInt16 TypeUint16 TypeInt32 TypeUint32 TypeInt64 TypeUint64 TypeFloat TypeDouble TypeDate TypeDatetime TypeTimestamp TypeInterval TypeTzDate TypeTzDatetime TypeTzTimestamp TypeString TypeUTF8 TypeYSON TypeJSON TypeUUID TypeJSONDocument TypeDyNumber )
Primitive TypesFromYDB known by YDB.
func (PrimitiveType) String ¶
func (t PrimitiveType) String() string
type Response ¶
type Response interface { GetOpReady() bool GetOpID() string GetStatus() Ydb.StatusIds_StatusCode GetIssues() []*Ydb_Issue.IssueMessage GetResult() *any.Any GetResponseProto() proto.Message }
func WrapNoOpResponse ¶
func WrapNoOpResponse(resp NoOpResponse) Response
func WrapOpResponse ¶
func WrapOpResponse(resp OpResponse) Response
type StreamOperation ¶
type StreamOperation struct {
// contains filtered or unexported fields
}
func WrapStreamOperation ¶
func WrapStreamOperation( method string, req proto.Message, resp StreamOperationResponse, p func(error), ) StreamOperation
type StreamOperationResponse ¶
type StreamOperationResponse interface { GetStatus() Ydb.StatusIds_StatusCode GetIssues() []*Ydb_Issue.IssueMessage }
StreamOperationResponse is an interface that provides access to the API-specific response fields.
NOTE: YDB API currently does not provide generic response wrapper as it does with RPC API. Thus wee need to generalize it by the hand using this interface.
This generalization is needed for checking status codes and issues in one place.
func UnwrapStreamOperation ¶
func UnwrapStreamOperation(op StreamOperation) ( method string, req proto.Message, resp StreamOperationResponse, processor func(error), )
type StructField ¶
func StructFields ¶
func StructFields(ms []*Ydb.StructMember) []StructField
type StructType ¶
type StructType struct {
Fields []StructField
}
func (StructType) Empty ¶
func (s StructType) Empty() bool
func (StructType) Members ¶
func (s StructType) Members() []*Ydb.StructMember
func (StructType) String ¶
func (s StructType) String() string
type StructValueProto ¶
type StructValueProto struct { Fields []StructField Values []*Ydb.Value }
func (*StructValueProto) Add ¶
func (s *StructValueProto) Add(name string, value V)
type T ¶
type T interface {
// contains filtered or unexported methods
}
func TypeFromYDB ¶
func TypesFromYDB ¶
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func DatetimeValue ¶
func DecimalValue ¶
func DoubleValue ¶
func DyNumberValue ¶
func FloatValue ¶
func Int16Value ¶
func Int32Value ¶
func Int64Value ¶
func IntervalValue ¶
func JSONDocumentValue ¶
func NullValue ¶
NullValue returns NULL value of given type T.
For example, if T is Int32Type, then NullValue(Int32Type) will return value of type Optional<Int32Type> with NULL value.
Nested optional types are handled also.
func OptionalValue ¶
func StringValue ¶
func StructValue ¶
func StructValue(p *StructValueProto) Value
func TimestampValue ¶
func TzDateValue ¶
func TzDatetimeValue ¶
func TzTimestampValue ¶
func Uint16Value ¶
func Uint32Value ¶
func Uint64Value ¶
func Uint8Value ¶
type VariantType ¶
type VariantType struct { S StructType T TupleType }
func (VariantType) String ¶
func (v VariantType) String() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cache
|
|
pb
|
|
Package ydbtest provides tools for stubbing ydb server up.
|
Package ydbtest provides tools for stubbing ydb server up. |
Package ydbtypes provides tools for integration ydb types with go/types package.
|
Package ydbtypes provides tools for integration ydb types with go/types package. |