primitive

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: 7 Imported by: 12

Documentation

Overview

Package primitive contains types and functions to read and write CQL protocol primitive structures, as defined in section 3 of the CQL protocol specifications.

Index

Constants

View Source
const (
	ProtocolVersion2 = ProtocolVersion(0x2)
	ProtocolVersion3 = ProtocolVersion(0x3)
	ProtocolVersion4 = ProtocolVersion(0x4)
	ProtocolVersion5 = ProtocolVersion(0x5)
)

Supported OSS versions

View Source
const (
	ProtocolVersionDse1 = ProtocolVersion(0b_1_000001) // 1 + DSE bit = 65
	ProtocolVersionDse2 = ProtocolVersion(0b_1_000010) // 2 + DSE bit = 66
)

Supported DSE versions Note: all DSE versions have the 7th bit set to 1

View Source
const (
	FrameHeaderLengthV3AndHigher = 9
	FrameHeaderLengthV2AndLower  = 8
)
View Source
const (
	OpCodeStartup      = OpCode(0x01)
	OpCodeOptions      = OpCode(0x05)
	OpCodeQuery        = OpCode(0x07)
	OpCodePrepare      = OpCode(0x09)
	OpCodeExecute      = OpCode(0x0A)
	OpCodeRegister     = OpCode(0x0B)
	OpCodeBatch        = OpCode(0x0D)
	OpCodeAuthResponse = OpCode(0x0F)
	OpCodeDseRevise    = OpCode(0xFF) // DSE v1
)

requests

View Source
const (
	OpCodeError         = OpCode(0x00)
	OpCodeReady         = OpCode(0x02)
	OpCodeAuthenticate  = OpCode(0x03)
	OpCodeSupported     = OpCode(0x06)
	OpCodeResult        = OpCode(0x08)
	OpCodeEvent         = OpCode(0x0C)
	OpCodeAuthChallenge = OpCode(0x0E)
	OpCodeAuthSuccess   = OpCode(0x10)
)

responses

View Source
const (
	ResultTypeVoid         = ResultType(0x00000001)
	ResultTypeRows         = ResultType(0x00000002)
	ResultTypeSetKeyspace  = ResultType(0x00000003)
	ResultTypePrepared     = ResultType(0x00000004)
	ResultTypeSchemaChange = ResultType(0x00000005)
)
View Source
const (
	ErrorCodeServerError         = ErrorCode(0x00000000)
	ErrorCodeProtocolError       = ErrorCode(0x0000000A)
	ErrorCodeAuthenticationError = ErrorCode(0x00000100)
)

0xx: fatal errors

View Source
const (
	ErrorCodeUnavailable     = ErrorCode(0x00001000)
	ErrorCodeOverloaded      = ErrorCode(0x00001001)
	ErrorCodeIsBootstrapping = ErrorCode(0x00001002)
	ErrorCodeTruncateError   = ErrorCode(0x00001003)
	ErrorCodeWriteTimeout    = ErrorCode(0x00001100)
	ErrorCodeReadTimeout     = ErrorCode(0x00001200)
	ErrorCodeReadFailure     = ErrorCode(0x00001300)
	ErrorCodeFunctionFailure = ErrorCode(0x00001400)
	ErrorCodeWriteFailure    = ErrorCode(0x00001500)
)

1xx: request execution

View Source
const (
	ErrorCodeSyntaxError   = ErrorCode(0x00002000)
	ErrorCodeUnauthorized  = ErrorCode(0x00002100)
	ErrorCodeInvalid       = ErrorCode(0x00002200)
	ErrorCodeConfigError   = ErrorCode(0x00002300)
	ErrorCodeAlreadyExists = ErrorCode(0x00002400)
	ErrorCodeUnprepared    = ErrorCode(0x00002500)
)

2xx: query validation

View Source
const (
	ConsistencyLevelAny         = ConsistencyLevel(0x0000)
	ConsistencyLevelOne         = ConsistencyLevel(0x0001)
	ConsistencyLevelTwo         = ConsistencyLevel(0x0002)
	ConsistencyLevelThree       = ConsistencyLevel(0x0003)
	ConsistencyLevelQuorum      = ConsistencyLevel(0x0004)
	ConsistencyLevelAll         = ConsistencyLevel(0x0005)
	ConsistencyLevelLocalQuorum = ConsistencyLevel(0x0006)
	ConsistencyLevelEachQuorum  = ConsistencyLevel(0x0007)
	ConsistencyLevelSerial      = ConsistencyLevel(0x0008)
	ConsistencyLevelLocalSerial = ConsistencyLevel(0x0009)
	ConsistencyLevelLocalOne    = ConsistencyLevel(0x000A)
)
View Source
const (
	WriteTypeSimple        = WriteType("SIMPLE")
	WriteTypeBatch         = WriteType("BATCH")
	WriteTypeUnloggedBatch = WriteType("UNLOGGED_BATCH")
	WriteTypeCounter       = WriteType("COUNTER")
	WriteTypeBatchLog      = WriteType("BATCH_LOG")
	WriteTypeCas           = WriteType("CAS")
	WriteTypeView          = WriteType("VIEW")
	WriteTypeCdc           = WriteType("CDC")
)
View Source
const (
	DataTypeCodeCustom    = DataTypeCode(0x0000)
	DataTypeCodeAscii     = DataTypeCode(0x0001)
	DataTypeCodeBigint    = DataTypeCode(0x0002)
	DataTypeCodeBlob      = DataTypeCode(0x0003)
	DataTypeCodeBoolean   = DataTypeCode(0x0004)
	DataTypeCodeCounter   = DataTypeCode(0x0005)
	DataTypeCodeDecimal   = DataTypeCode(0x0006)
	DataTypeCodeDouble    = DataTypeCode(0x0007)
	DataTypeCodeFloat     = DataTypeCode(0x0008)
	DataTypeCodeInt       = DataTypeCode(0x0009)
	DataTypeCodeText      = DataTypeCode(0x000A) // removed in v3, alias for DataTypeCodeVarchar
	DataTypeCodeTimestamp = DataTypeCode(0x000B)
	DataTypeCodeUuid      = DataTypeCode(0x000C)
	DataTypeCodeVarchar   = DataTypeCode(0x000D)
	DataTypeCodeVarint    = DataTypeCode(0x000E)
	DataTypeCodeTimeuuid  = DataTypeCode(0x000F)
	DataTypeCodeInet      = DataTypeCode(0x0010)
	DataTypeCodeDate      = DataTypeCode(0x0011) // v4+
	DataTypeCodeTime      = DataTypeCode(0x0012) // v4+
	DataTypeCodeSmallint  = DataTypeCode(0x0013) // v4+
	DataTypeCodeTinyint   = DataTypeCode(0x0014) // v4+
	DataTypeCodeDuration  = DataTypeCode(0x0015) // v5, DSE v1 and DSE v2
	DataTypeCodeList      = DataTypeCode(0x0020)
	DataTypeCodeMap       = DataTypeCode(0x0021)
	DataTypeCodeSet       = DataTypeCode(0x0022)
	DataTypeCodeUdt       = DataTypeCode(0x0030) // v3+
	DataTypeCodeTuple     = DataTypeCode(0x0031) // v3+
)
View Source
const (
	EventTypeTopologyChange = EventType("TOPOLOGY_CHANGE")
	EventTypeStatusChange   = EventType("STATUS_CHANGE")
	EventTypeSchemaChange   = EventType("SCHEMA_CHANGE")
)
View Source
const (
	SchemaChangeTypeCreated = SchemaChangeType("CREATED")
	SchemaChangeTypeUpdated = SchemaChangeType("UPDATED")
	SchemaChangeTypeDropped = SchemaChangeType("DROPPED")
)
View Source
const (
	SchemaChangeTargetKeyspace  = SchemaChangeTarget("KEYSPACE")
	SchemaChangeTargetTable     = SchemaChangeTarget("TABLE")
	SchemaChangeTargetType      = SchemaChangeTarget("TYPE")      // v3+
	SchemaChangeTargetFunction  = SchemaChangeTarget("FUNCTION")  // v3+
	SchemaChangeTargetAggregate = SchemaChangeTarget("AGGREGATE") // v3+
)
View Source
const (
	TopologyChangeTypeNewNode     = TopologyChangeType("NEW_NODE")
	TopologyChangeTypeRemovedNode = TopologyChangeType("REMOVED_NODE")
	TopologyChangeTypeMovedNode   = TopologyChangeType("MOVED_NODE") // v3+
)
View Source
const (
	StatusChangeTypeUp   = StatusChangeType("UP")
	StatusChangeTypeDown = StatusChangeType("DOWN")
)
View Source
const (
	BatchTypeLogged   = BatchType(0x00)
	BatchTypeUnlogged = BatchType(0x01)
	BatchTypeCounter  = BatchType(0x02)
)
View Source
const (
	BatchChildTypeQueryString = BatchChildType(0x00)
	BatchChildTypePreparedId  = BatchChildType(0x01)
)
View Source
const (
	HeaderFlagCompressed    = HeaderFlag(0x01)
	HeaderFlagTracing       = HeaderFlag(0x02)
	HeaderFlagCustomPayload = HeaderFlag(0x04)
	HeaderFlagWarning       = HeaderFlag(0x08)
	HeaderFlagUseBeta       = HeaderFlag(0x10)
)
View Source
const (
	QueryFlagValues            = QueryFlag(0x00000001)
	QueryFlagSkipMetadata      = QueryFlag(0x00000002)
	QueryFlagPageSize          = QueryFlag(0x00000004)
	QueryFlagPagingState       = QueryFlag(0x00000008)
	QueryFlagSerialConsistency = QueryFlag(0x00000010)
	QueryFlagDefaultTimestamp  = QueryFlag(0x00000020)
	QueryFlagValueNames        = QueryFlag(0x00000040)
	QueryFlagWithKeyspace      = QueryFlag(0x00000080) // protocol v5+ and DSE v2
	QueryFlagNowInSeconds      = QueryFlag(0x00000100) // protocol v5+
)
View Source
const (
	QueryFlagDsePageSizeBytes               = QueryFlag(0x40000000) // DSE v1+
	QueryFlagDseWithContinuousPagingOptions = QueryFlag(0x80000000) // DSE v1+
)

DSE-specific query flags

View Source
const (
	RowsFlagGlobalTablesSpec = RowsFlag(0x00000001)
	RowsFlagHasMorePages     = RowsFlag(0x00000002)
	RowsFlagNoMetadata       = RowsFlag(0x00000004)
	RowsFlagMetadataChanged  = RowsFlag(0x00000008)
)
View Source
const (
	RowsFlagDseContinuousPaging   = RowsFlag(0x40000000) // DSE v1+
	RowsFlagDseLastContinuousPage = RowsFlag(0x80000000) // DSE v1+
)

DSE-specific rows flags

View Source
const (
	DseRevisionTypeCancelContinuousPaging = DseRevisionType(0x00000001)
	DseRevisionTypeMoreContinuousPages    = DseRevisionType(0x00000002) // DSE v2+
)
View Source
const (
	FailureCodeUnknown               = FailureCode(0x0000)
	FailureCodeTooManyTombstonesRead = FailureCode(0x0001)
	FailureCodeIndexNotAvailable     = FailureCode(0x0002)
	FailureCodeCdcSpaceFull          = FailureCode(0x0003)
	FailureCodeCounterWrite          = FailureCode(0x0004)
	FailureCodeTableNotFound         = FailureCode(0x0005)
	FailureCodeKeyspaceNotFound      = FailureCode(0x0006)
)
View Source
const (
	LengthOfByte  = 1
	LengthOfShort = 2
	LengthOfInt   = 4
	LengthOfLong  = 8
)
View Source
const (
	ValueTypeRegular = ValueType(0)
	ValueTypeNull    = ValueType(-1)
	ValueTypeUnset   = ValueType(-2)
)
View Source
const LengthOfUuid = 16
View Source
const (
	PrepareFlagWithKeyspace = PrepareFlag(0x00000001) // v5 and DSE v2
)
View Source
const (
	VariablesFlagGlobalTablesSpec = VariablesFlag(0x00000001)
)

Variables

This section is empty.

Functions

func CheckDseProtocolVersion

func CheckDseProtocolVersion(version ProtocolVersion) error

func CheckRequestOpCode

func CheckRequestOpCode(code OpCode) error

func CheckResponseOpCode

func CheckResponseOpCode(code OpCode) error

func CheckSerialConsistencyLevel

func CheckSerialConsistencyLevel(consistency ConsistencyLevel) error

func CheckSupportedProtocolVersion

func CheckSupportedProtocolVersion(version ProtocolVersion) error

func CheckValidBatchType

func CheckValidBatchType(batchType BatchType) error

func CheckValidConsistencyLevel

func CheckValidConsistencyLevel(consistency ConsistencyLevel) error

func CheckValidDataTypeCode

func CheckValidDataTypeCode(code DataTypeCode, version ProtocolVersion) error

func CheckValidDseRevisionType

func CheckValidDseRevisionType(t DseRevisionType, version ProtocolVersion) error

func CheckValidEventType

func CheckValidEventType(eventType EventType) error

func CheckValidFailureCode

func CheckValidFailureCode(c FailureCode) error

func CheckValidOpCode

func CheckValidOpCode(code OpCode) error

func CheckValidResultType

func CheckValidResultType(t ResultType) error

func CheckValidSchemaChangeTarget

func CheckValidSchemaChangeTarget(target SchemaChangeTarget, version ProtocolVersion) error

func CheckValidSchemaChangeType

func CheckValidSchemaChangeType(t SchemaChangeType) error

func CheckValidStatusChangeType

func CheckValidStatusChangeType(t StatusChangeType) error

func CheckValidTopologyChangeType

func CheckValidTopologyChangeType(t TopologyChangeType, version ProtocolVersion) error

func CheckValidWriteType

func CheckValidWriteType(writeType WriteType) error

func LengthOfBytes

func LengthOfBytes(b []byte) int

func LengthOfBytesMap

func LengthOfBytesMap(m map[string][]byte) int

func LengthOfInet

func LengthOfInet(inet *Inet) (length int, err error)

func LengthOfInetAddr

func LengthOfInetAddr(inetAddr net.IP) (length int, err error)

func LengthOfLongString

func LengthOfLongString(s string) int

func LengthOfNamedValues

func LengthOfNamedValues(values map[string]*Value) (length int, err error)

func LengthOfPositionalValues

func LengthOfPositionalValues(values []*Value) (length int, err error)

func LengthOfReasonMap

func LengthOfReasonMap(reasonMap []*FailureReason) (int, error)

func LengthOfShortBytes

func LengthOfShortBytes(b []byte) int

func LengthOfString

func LengthOfString(s string) int

func LengthOfStringList

func LengthOfStringList(list []string) int

func LengthOfStringMap

func LengthOfStringMap(m map[string]string) int

func LengthOfStringMultiMap

func LengthOfStringMultiMap(m map[string][]string) int

func LengthOfUnsignedVint

func LengthOfUnsignedVint(v uint64) int

func LengthOfValue

func LengthOfValue(value *Value) (int, error)

func LengthOfVint

func LengthOfVint(v int64) int

func ReadByte

func ReadByte(source io.Reader) (decoded uint8, err error)

func ReadBytes

func ReadBytes(source io.Reader) ([]byte, error)

func ReadBytesMap

func ReadBytesMap(source io.Reader) (map[string][]byte, error)

func ReadInetAddr

func ReadInetAddr(source io.Reader) (net.IP, error)

func ReadInt

func ReadInt(source io.Reader) (decoded int32, err error)

func ReadLong

func ReadLong(source io.Reader) (decoded int64, err error)

func ReadLongString

func ReadLongString(source io.Reader) (string, error)

func ReadNamedValues

func ReadNamedValues(source io.Reader, version ProtocolVersion) (map[string]*Value, error)

func ReadShort

func ReadShort(source io.Reader) (decoded uint16, err error)

func ReadShortBytes

func ReadShortBytes(source io.Reader) ([]byte, error)

func ReadStreamId

func ReadStreamId(source io.Reader, version ProtocolVersion) (int16, error)

ReadStreamId reads a stream id from the given source, using the given version to determine if the stream id is a 16-bit integer (versions 3+) or an 8-bit integer (versions 1 and 2).

func ReadString

func ReadString(source io.Reader) (string, error)

func ReadStringList

func ReadStringList(source io.Reader) (decoded []string, err error)

func ReadStringMap

func ReadStringMap(source io.Reader) (map[string]string, error)

func ReadStringMultiMap

func ReadStringMultiMap(source io.Reader) (decoded map[string][]string, err error)

func ReadUnsignedVint

func ReadUnsignedVint(source io.Reader) (val uint64, read int, err error)

func ReadVint

func ReadVint(source io.Reader) (val int64, read int, err error)

func WriteByte

func WriteByte(b uint8, dest io.Writer) error

func WriteBytes

func WriteBytes(b []byte, dest io.Writer) error

func WriteBytesMap

func WriteBytesMap(m map[string][]byte, dest io.Writer) error

func WriteInet

func WriteInet(inet *Inet, dest io.Writer) error

func WriteInetAddr

func WriteInetAddr(inetAddr net.IP, dest io.Writer) error

func WriteInt

func WriteInt(i int32, dest io.Writer) error

func WriteLong

func WriteLong(l int64, dest io.Writer) error

func WriteLongString

func WriteLongString(s string, dest io.Writer) error

func WriteNamedValues

func WriteNamedValues(values map[string]*Value, dest io.Writer, version ProtocolVersion) error

func WritePositionalValues

func WritePositionalValues(values []*Value, dest io.Writer, version ProtocolVersion) error

func WriteReasonMap

func WriteReasonMap(reasonMap []*FailureReason, dest io.Writer) error

func WriteShort

func WriteShort(i uint16, dest io.Writer) error

func WriteShortBytes

func WriteShortBytes(b []byte, dest io.Writer) error

func WriteStreamId

func WriteStreamId(streamId int16, dest io.Writer, version ProtocolVersion) error

WriteStreamId writes the given stream id to the given destination, using the given version to determine if the stream id is a 16-bit integer (versions 3+) or an 8-bit integer (versions 1 and 2).

func WriteString

func WriteString(s string, dest io.Writer) error

func WriteStringList

func WriteStringList(list []string, dest io.Writer) error

func WriteStringMap

func WriteStringMap(m map[string]string, dest io.Writer) error

func WriteStringMultiMap

func WriteStringMultiMap(m map[string][]string, dest io.Writer) error

func WriteUnsignedVint

func WriteUnsignedVint(v uint64, dest io.Writer) (written int, err error)

func WriteUuid

func WriteUuid(uuid *UUID, dest io.Writer) error

func WriteValue

func WriteValue(value *Value, dest io.Writer, version ProtocolVersion) error

func WriteVint

func WriteVint(v int64, dest io.Writer) (written int, err error)

Types

type BatchChildType

type BatchChildType uint8

func (BatchChildType) IsValid

func (t BatchChildType) IsValid() bool

func (BatchChildType) String

func (t BatchChildType) String() string

type BatchType

type BatchType uint8

func (BatchType) IsValid

func (t BatchType) IsValid() bool

func (BatchType) String

func (t BatchType) String() string

type Compression

type Compression string
const (
	CompressionNone   Compression = "NONE"
	CompressionLz4    Compression = "LZ4"
	CompressionSnappy Compression = "SNAPPY"
)

func (Compression) IsValid

func (c Compression) IsValid() bool

type ConsistencyLevel

type ConsistencyLevel uint16

ConsistencyLevel corresponds to protocol section 3 [consistency] data type.

func (ConsistencyLevel) IsLocal

func (c ConsistencyLevel) IsLocal() bool

func (ConsistencyLevel) IsNonLocal

func (c ConsistencyLevel) IsNonLocal() bool

func (ConsistencyLevel) IsNonSerial

func (c ConsistencyLevel) IsNonSerial() bool

func (ConsistencyLevel) IsSerial

func (c ConsistencyLevel) IsSerial() bool

func (ConsistencyLevel) IsValid

func (c ConsistencyLevel) IsValid() bool

func (ConsistencyLevel) String

func (c ConsistencyLevel) String() string

type DataTypeCode

type DataTypeCode uint16

func (DataTypeCode) IsPrimitive

func (c DataTypeCode) IsPrimitive() bool

func (DataTypeCode) IsValid

func (c DataTypeCode) IsValid() bool

func (DataTypeCode) String

func (c DataTypeCode) String() string

type DseRevisionType

type DseRevisionType uint32

func (DseRevisionType) IsValid

func (t DseRevisionType) IsValid() bool

func (DseRevisionType) String

func (t DseRevisionType) String() string

type ErrorCode

type ErrorCode uint32

func (ErrorCode) IsFatalError

func (c ErrorCode) IsFatalError() bool

func (ErrorCode) IsQueryValidationError

func (c ErrorCode) IsQueryValidationError() bool

func (ErrorCode) IsRequestExecutionError

func (c ErrorCode) IsRequestExecutionError() bool

func (ErrorCode) IsValid

func (c ErrorCode) IsValid() bool

func (ErrorCode) String

func (c ErrorCode) String() string

type EventType

type EventType string

func (EventType) IsValid

func (e EventType) IsValid() bool

type FailureCode

type FailureCode uint16

func (FailureCode) IsValid

func (c FailureCode) IsValid() bool

func (FailureCode) String

func (c FailureCode) String() string

type FailureReason

type FailureReason struct {
	Endpoint net.IP
	Code     FailureCode
}

FailureReason is a map entry for a <reasonmap>; it contains the endpoint that failed and the corresponding failure code. +k8s:deepcopy-gen=true

func ReadReasonMap

func ReadReasonMap(source io.Reader) ([]*FailureReason, error)

func (*FailureReason) DeepCopy

func (in *FailureReason) DeepCopy() *FailureReason

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

func (*FailureReason) DeepCopyInto

func (in *FailureReason) DeepCopyInto(out *FailureReason)

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

type HeaderFlag

type HeaderFlag uint8

func (HeaderFlag) Add

func (f HeaderFlag) Add(other HeaderFlag) HeaderFlag

func (HeaderFlag) Contains

func (f HeaderFlag) Contains(other HeaderFlag) bool

func (HeaderFlag) Remove

func (f HeaderFlag) Remove(other HeaderFlag) HeaderFlag

func (HeaderFlag) String

func (f HeaderFlag) String() string

type Inet

type Inet struct {
	Addr net.IP
	Port int32
}

Inet is the [inet] protocol type. It is the combination of a net.IP + port number. +k8s:deepcopy-gen=true

func ReadInet

func ReadInet(source io.Reader) (*Inet, error)

func (*Inet) DeepCopy

func (in *Inet) DeepCopy() *Inet

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

func (*Inet) DeepCopyInto

func (in *Inet) DeepCopyInto(out *Inet)

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

func (Inet) String

func (i Inet) String() string

type OpCode

type OpCode uint8

func (OpCode) IsDse

func (c OpCode) IsDse() bool

func (OpCode) IsRequest

func (c OpCode) IsRequest() bool

func (OpCode) IsResponse

func (c OpCode) IsResponse() bool

func (OpCode) IsValid

func (c OpCode) IsValid() bool

func (OpCode) String

func (c OpCode) String() string

type PrepareFlag

type PrepareFlag uint32

func (PrepareFlag) Add

func (f PrepareFlag) Add(other PrepareFlag) PrepareFlag

func (PrepareFlag) Contains

func (f PrepareFlag) Contains(other PrepareFlag) bool

func (PrepareFlag) Remove

func (f PrepareFlag) Remove(other PrepareFlag) PrepareFlag

func (PrepareFlag) String

func (f PrepareFlag) String() string

type ProtocolVersion

type ProtocolVersion uint8

func SupportedBetaProtocolVersions

func SupportedBetaProtocolVersions() []ProtocolVersion

func SupportedDseProtocolVersions

func SupportedDseProtocolVersions() []ProtocolVersion

func SupportedNonBetaProtocolVersions

func SupportedNonBetaProtocolVersions() []ProtocolVersion

func SupportedOssProtocolVersions

func SupportedOssProtocolVersions() []ProtocolVersion

func SupportedProtocolVersions

func SupportedProtocolVersions() []ProtocolVersion

SupportedProtocolVersions returns a slice containing all the protocol versions supported by this library.

func SupportedProtocolVersionsGreaterThan

func SupportedProtocolVersionsGreaterThan(version ProtocolVersion) []ProtocolVersion

func SupportedProtocolVersionsGreaterThanOrEqualTo

func SupportedProtocolVersionsGreaterThanOrEqualTo(version ProtocolVersion) []ProtocolVersion

func SupportedProtocolVersionsLesserThan

func SupportedProtocolVersionsLesserThan(version ProtocolVersion) []ProtocolVersion

func SupportedProtocolVersionsLesserThanOrEqualTo

func SupportedProtocolVersionsLesserThanOrEqualTo(version ProtocolVersion) []ProtocolVersion

func (ProtocolVersion) FrameHeaderLengthInBytes

func (v ProtocolVersion) FrameHeaderLengthInBytes() int

func (ProtocolVersion) IsBeta

func (v ProtocolVersion) IsBeta() bool

func (ProtocolVersion) IsDse

func (v ProtocolVersion) IsDse() bool

func (ProtocolVersion) IsOss

func (v ProtocolVersion) IsOss() bool

func (ProtocolVersion) IsSupported

func (v ProtocolVersion) IsSupported() bool

func (ProtocolVersion) String

func (v ProtocolVersion) String() string

func (ProtocolVersion) SupportsBatchQueryFlags

func (v ProtocolVersion) SupportsBatchQueryFlags() bool

func (ProtocolVersion) SupportsCompression

func (v ProtocolVersion) SupportsCompression(compression Compression) bool

func (ProtocolVersion) SupportsDataType

func (v ProtocolVersion) SupportsDataType(code DataTypeCode) bool

func (ProtocolVersion) SupportsDseRevisionType

func (v ProtocolVersion) SupportsDseRevisionType(t DseRevisionType) bool

func (ProtocolVersion) SupportsModernFramingLayout

func (v ProtocolVersion) SupportsModernFramingLayout() bool

func (ProtocolVersion) SupportsPrepareFlags

func (v ProtocolVersion) SupportsPrepareFlags() bool

func (ProtocolVersion) SupportsQueryFlag

func (v ProtocolVersion) SupportsQueryFlag(flag QueryFlag) bool

func (ProtocolVersion) SupportsReadWriteFailureReasonMap

func (v ProtocolVersion) SupportsReadWriteFailureReasonMap() bool

func (ProtocolVersion) SupportsResultMetadataId

func (v ProtocolVersion) SupportsResultMetadataId() bool

func (ProtocolVersion) SupportsSchemaChangeTarget

func (v ProtocolVersion) SupportsSchemaChangeTarget(target SchemaChangeTarget) bool

func (ProtocolVersion) SupportsTopologyChangeType

func (v ProtocolVersion) SupportsTopologyChangeType(t TopologyChangeType) bool

func (ProtocolVersion) SupportsUnsetValues

func (v ProtocolVersion) SupportsUnsetValues() bool

func (ProtocolVersion) SupportsWriteTimeoutContentions

func (v ProtocolVersion) SupportsWriteTimeoutContentions() bool

func (ProtocolVersion) Uses4BytesCollectionLength

func (v ProtocolVersion) Uses4BytesCollectionLength() bool

func (ProtocolVersion) Uses4BytesQueryFlags

func (v ProtocolVersion) Uses4BytesQueryFlags() bool

type QueryFlag

type QueryFlag uint32

QueryFlag was encoded as [byte] in v3 and v4, but changed to [int] in v5.

func (QueryFlag) Add

func (f QueryFlag) Add(other QueryFlag) QueryFlag

func (QueryFlag) Contains

func (f QueryFlag) Contains(other QueryFlag) bool

func (QueryFlag) Remove

func (f QueryFlag) Remove(other QueryFlag) QueryFlag

func (QueryFlag) String

func (f QueryFlag) String() string

type ResultType

type ResultType uint32

func (ResultType) IsValid

func (t ResultType) IsValid() bool

func (ResultType) String

func (t ResultType) String() string

type RowsFlag

type RowsFlag uint32

func (RowsFlag) Add

func (f RowsFlag) Add(other RowsFlag) RowsFlag

func (RowsFlag) Contains

func (f RowsFlag) Contains(other RowsFlag) bool

func (RowsFlag) Remove

func (f RowsFlag) Remove(other RowsFlag) RowsFlag

func (RowsFlag) String

func (f RowsFlag) String() string

type SchemaChangeTarget

type SchemaChangeTarget string

func (SchemaChangeTarget) IsValid

func (t SchemaChangeTarget) IsValid() bool

type SchemaChangeType

type SchemaChangeType string

func (SchemaChangeType) IsValid

func (t SchemaChangeType) IsValid() bool

type StatusChangeType

type StatusChangeType string

func (StatusChangeType) IsValid

func (t StatusChangeType) IsValid() bool

type TopologyChangeType

type TopologyChangeType string

func (TopologyChangeType) IsValid

func (t TopologyChangeType) IsValid() bool

type UUID

type UUID [16]byte

func ParseUuid

func ParseUuid(input string) (*UUID, error)

ParseUuid parses a 32 digit hexadecimal number (that might contain hyphens) representing an UUID.

func ReadUuid

func ReadUuid(source io.Reader) (*UUID, error)

func (*UUID) Bytes

func (u *UUID) Bytes() []byte

Bytes returns the raw byte slice for this UUID. A UUID is always 128 bits (16 bytes) long.

func (*UUID) DeepCopy

func (u *UUID) DeepCopy() *UUID

func (*UUID) String

func (u *UUID) String() string

type Value

type Value struct {
	Type     ValueType
	Contents []byte
}

Value models the [value] protocol primitive structure. +k8s:deepcopy-gen=true

func NewNullValue

func NewNullValue() *Value

func NewUnsetValue

func NewUnsetValue() *Value

func NewValue

func NewValue(contents []byte) *Value

func ReadPositionalValues

func ReadPositionalValues(source io.Reader, version ProtocolVersion) ([]*Value, error)

func ReadValue

func ReadValue(source io.Reader, version ProtocolVersion) (*Value, error)

func (*Value) DeepCopy

func (in *Value) DeepCopy() *Value

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

func (*Value) DeepCopyInto

func (in *Value) DeepCopyInto(out *Value)

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

type ValueType

type ValueType = int32

type VariablesFlag

type VariablesFlag uint32

func (VariablesFlag) Add

func (VariablesFlag) Contains

func (f VariablesFlag) Contains(other VariablesFlag) bool

func (VariablesFlag) Remove

func (f VariablesFlag) Remove(other VariablesFlag) VariablesFlag

func (VariablesFlag) String

func (f VariablesFlag) String() string

type WriteType

type WriteType string

func (WriteType) IsValid

func (t WriteType) IsValid() bool

Jump to

Keyboard shortcuts

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