Documentation
¶
Overview ¶
Package datatype contains interfaces, types for interacting with CQL data type definitions, as well as functions to read and write CQL data type signatures, as defined in section 6 of the CQL protocol specifications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Ascii = &PrimitiveType{code: primitive.DataTypeCodeAscii} Bigint = &PrimitiveType{code: primitive.DataTypeCodeBigint} Blob = &PrimitiveType{code: primitive.DataTypeCodeBlob} Boolean = &PrimitiveType{code: primitive.DataTypeCodeBoolean} Counter = &PrimitiveType{code: primitive.DataTypeCodeCounter} Date = &PrimitiveType{code: primitive.DataTypeCodeDate} Decimal = &PrimitiveType{code: primitive.DataTypeCodeDecimal} Double = &PrimitiveType{code: primitive.DataTypeCodeDouble} Duration = &PrimitiveType{code: primitive.DataTypeCodeDuration} Float = &PrimitiveType{code: primitive.DataTypeCodeFloat} Inet = &PrimitiveType{code: primitive.DataTypeCodeInet} Int = &PrimitiveType{code: primitive.DataTypeCodeInt} Smallint = &PrimitiveType{code: primitive.DataTypeCodeSmallint} Time = &PrimitiveType{code: primitive.DataTypeCodeTime} Timestamp = &PrimitiveType{code: primitive.DataTypeCodeTimestamp} Timeuuid = &PrimitiveType{code: primitive.DataTypeCodeTimeuuid} Tinyint = &PrimitiveType{code: primitive.DataTypeCodeTinyint} Uuid = &PrimitiveType{code: primitive.DataTypeCodeUuid} Varchar = &PrimitiveType{code: primitive.DataTypeCodeVarchar} Varint = &PrimitiveType{code: primitive.DataTypeCodeVarint} )
Functions ¶
func LengthOfDataType ¶
func LengthOfDataType(t DataType, version primitive.ProtocolVersion) (length int, err error)
func WriteDataType ¶
Types ¶
type Custom ¶
type Custom struct {
ClassName string
}
Custom is a data type that represents a CQL custom type. +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/datastax/go-cassandra-native-protocol/datatype.DataType
func (*Custom) Code ¶
func (t *Custom) Code() primitive.DataTypeCode
func (*Custom) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Custom.
func (*Custom) DeepCopyDataType ¶
DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.
func (*Custom) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DataType ¶
type DataType interface { Code() primitive.DataTypeCode AsCql() string DeepCopyDataType() DataType }
func ReadDataType ¶
type List ¶
type List struct {
ElementType DataType
}
List is a data type that represents a CQL list type. +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/datastax/go-cassandra-native-protocol/datatype.DataType
func (*List) Code ¶
func (t *List) Code() primitive.DataTypeCode
func (*List) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new List.
func (*List) DeepCopyDataType ¶
DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.
func (*List) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Map ¶
Map is a data type that represents a CQL map type. +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/datastax/go-cassandra-native-protocol/datatype.DataType
func (*Map) Code ¶
func (t *Map) Code() primitive.DataTypeCode
func (*Map) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Map.
func (*Map) DeepCopyDataType ¶
DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.
func (*Map) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PrimitiveType ¶
type PrimitiveType struct {
// contains filtered or unexported fields
}
PrimitiveType is a datatype that is represented by a CQL scalar type. +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/datastax/go-cassandra-native-protocol/datatype.DataType
func (*PrimitiveType) AsCql ¶
func (t *PrimitiveType) AsCql() string
func (*PrimitiveType) Code ¶
func (t *PrimitiveType) Code() primitive.DataTypeCode
func (*PrimitiveType) DeepCopy ¶
func (in *PrimitiveType) DeepCopy() *PrimitiveType
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrimitiveType.
func (*PrimitiveType) DeepCopyDataType ¶
func (in *PrimitiveType) DeepCopyDataType() DataType
DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.
func (*PrimitiveType) DeepCopyInto ¶
func (in *PrimitiveType) DeepCopyInto(out *PrimitiveType)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PrimitiveType) String ¶
func (t *PrimitiveType) String() string
type Set ¶
type Set struct {
ElementType DataType
}
Set is a data type that represents a CQL set type. +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/datastax/go-cassandra-native-protocol/datatype.DataType
func (*Set) Code ¶
func (t *Set) Code() primitive.DataTypeCode
func (*Set) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Set.
func (*Set) DeepCopyDataType ¶
DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.
func (*Set) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Tuple ¶
type Tuple struct {
FieldTypes []DataType
}
Tuple is a data type that represents a CQL tuple type. +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/datastax/go-cassandra-native-protocol/datatype.DataType
func (*Tuple) Code ¶
func (t *Tuple) Code() primitive.DataTypeCode
func (*Tuple) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tuple.
func (*Tuple) DeepCopyDataType ¶
DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.
func (*Tuple) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UserDefined ¶
UserDefined is a data type that represents a CQL user-defined type. +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/datastax/go-cassandra-native-protocol/datatype.DataType
func NewUserDefined ¶
func (*UserDefined) AsCql ¶
func (t *UserDefined) AsCql() string
func (*UserDefined) Code ¶
func (t *UserDefined) Code() primitive.DataTypeCode
func (*UserDefined) DeepCopy ¶
func (in *UserDefined) DeepCopy() *UserDefined
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDefined.
func (*UserDefined) DeepCopyDataType ¶
func (in *UserDefined) DeepCopyDataType() DataType
DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.
func (*UserDefined) DeepCopyInto ¶
func (in *UserDefined) DeepCopyInto(out *UserDefined)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*UserDefined) String ¶
func (t *UserDefined) String() string