datatype

package
v0.0.0-...-5e8aad0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 13

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

Functions

func LengthOfDataType

func LengthOfDataType(t DataType, version primitive.ProtocolVersion) (length int, err error)

func WriteDataType

func WriteDataType(t DataType, dest io.Writer, version primitive.ProtocolVersion) (err error)

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 NewCustom

func NewCustom(className string) *Custom

func (*Custom) AsCql

func (t *Custom) AsCql() string

func (*Custom) Code

func (t *Custom) Code() primitive.DataTypeCode

func (*Custom) DeepCopy

func (in *Custom) DeepCopy() *Custom

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Custom.

func (*Custom) DeepCopyDataType

func (in *Custom) DeepCopyDataType() DataType

DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.

func (*Custom) DeepCopyInto

func (in *Custom) DeepCopyInto(out *Custom)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Custom) String

func (t *Custom) String() string

type DataType

type DataType interface {
	Code() primitive.DataTypeCode
	AsCql() string
	DeepCopyDataType() DataType
}

func ReadDataType

func ReadDataType(source io.Reader, version primitive.ProtocolVersion) (decoded DataType, err error)

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 NewList

func NewList(elementType DataType) *List

func (*List) AsCql

func (t *List) AsCql() string

func (*List) Code

func (t *List) Code() primitive.DataTypeCode

func (*List) DeepCopy

func (in *List) DeepCopy() *List

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new List.

func (*List) DeepCopyDataType

func (in *List) DeepCopyDataType() DataType

DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.

func (*List) DeepCopyInto

func (in *List) DeepCopyInto(out *List)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*List) String

func (t *List) String() string

type Map

type Map struct {
	KeyType   DataType
	ValueType DataType
}

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 NewMap

func NewMap(keyType DataType, valueType DataType) *Map

func (*Map) AsCql

func (t *Map) AsCql() string

func (*Map) Code

func (t *Map) Code() primitive.DataTypeCode

func (*Map) DeepCopy

func (in *Map) DeepCopy() *Map

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Map.

func (*Map) DeepCopyDataType

func (in *Map) DeepCopyDataType() DataType

DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.

func (*Map) DeepCopyInto

func (in *Map) DeepCopyInto(out *Map)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Map) String

func (t *Map) String() string

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 (*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 NewSet

func NewSet(elementType DataType) *Set

func (*Set) AsCql

func (t *Set) AsCql() string

func (*Set) Code

func (t *Set) Code() primitive.DataTypeCode

func (*Set) DeepCopy

func (in *Set) DeepCopy() *Set

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Set.

func (*Set) DeepCopyDataType

func (in *Set) DeepCopyDataType() DataType

DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.

func (*Set) DeepCopyInto

func (in *Set) DeepCopyInto(out *Set)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Set) String

func (t *Set) String() string

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 NewTuple

func NewTuple(fieldTypes ...DataType) *Tuple

func (*Tuple) AsCql

func (t *Tuple) AsCql() string

func (*Tuple) Code

func (t *Tuple) Code() primitive.DataTypeCode

func (*Tuple) DeepCopy

func (in *Tuple) DeepCopy() *Tuple

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tuple.

func (*Tuple) DeepCopyDataType

func (in *Tuple) DeepCopyDataType() DataType

DeepCopyDataType is an autogenerated deepcopy function, copying the receiver, creating a new DataType.

func (*Tuple) DeepCopyInto

func (in *Tuple) DeepCopyInto(out *Tuple)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Tuple) String

func (t *Tuple) String() string

type UserDefined

type UserDefined struct {
	Keyspace   string
	Name       string
	FieldNames []string
	FieldTypes []DataType
}

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 NewUserDefined(keyspace string, name string, fieldNames []string, fieldTypes []DataType) (*UserDefined, error)

func (*UserDefined) AsCql

func (t *UserDefined) AsCql() string

func (*UserDefined) Code

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

Jump to

Keyboard shortcuts

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