packet

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Compression_name = map[int32]string{
		0: "COMPRESSIONCOMPATIBLEPROTO2",
		1: "NONE",
		2: "ZLIB",
		3: "GZIP",
		4: "LZF",
	}
	Compression_value = map[string]int32{
		"COMPRESSIONCOMPATIBLEPROTO2": 0,
		"NONE":                        1,
		"ZLIB":                        2,
		"GZIP":                        3,
		"LZF":                         4,
	}
)

Enum value maps for Compression.

View Source
var (
	PacketType_name = map[int32]string{
		0:  "PACKAGETYPECOMPATIBLEPROTO2",
		1:  "HANDSHAKE",
		2:  "CLIENTAUTHENTICATION",
		3:  "ACK",
		4:  "SUBSCRIPTION",
		5:  "UNSUBSCRIPTION",
		6:  "GET",
		7:  "MESSAGES",
		8:  "CLIENTACK",
		9:  "SHUTDOWN",
		10: "DUMP",
		11: "HEARTBEAT",
		12: "CLIENTROLLBACK",
	}
	PacketType_value = map[string]int32{
		"PACKAGETYPECOMPATIBLEPROTO2": 0,
		"HANDSHAKE":                   1,
		"CLIENTAUTHENTICATION":        2,
		"ACK":                         3,
		"SUBSCRIPTION":                4,
		"UNSUBSCRIPTION":              5,
		"GET":                         6,
		"MESSAGES":                    7,
		"CLIENTACK":                   8,
		"SHUTDOWN":                    9,
		"DUMP":                        10,
		"HEARTBEAT":                   11,
		"CLIENTROLLBACK":              12,
	}
)

Enum value maps for PacketType.

View Source
var File_CanalProtocol_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Ack

type Ack struct {

	// [default = 0]
	//
	// Types that are assignable to ErrorCodePresent:
	//
	//	*Ack_ErrorCode
	ErrorCodePresent isAck_ErrorCodePresent `protobuf_oneof:"error_code_present"`
	ErrorMessage     string                 `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` // if something like compression is not supported, erorr_message will tell about it.
	// contains filtered or unexported fields
}

func (*Ack) Descriptor deprecated

func (*Ack) Descriptor() ([]byte, []int)

Deprecated: Use Ack.ProtoReflect.Descriptor instead.

func (*Ack) GetErrorCode

func (x *Ack) GetErrorCode() int32

func (*Ack) GetErrorCodePresent

func (m *Ack) GetErrorCodePresent() isAck_ErrorCodePresent

func (*Ack) GetErrorMessage

func (x *Ack) GetErrorMessage() string

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) ProtoReflect

func (x *Ack) ProtoReflect() protoreflect.Message

func (*Ack) Reset

func (x *Ack) Reset()

func (*Ack) String

func (x *Ack) String() string

type Ack_ErrorCode

type Ack_ErrorCode struct {
	ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,oneof"`
}

type ClientAck

type ClientAck struct {
	Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	BatchId     int64  `protobuf:"varint,3,opt,name=batch_id,json=batchId,proto3" json:"batch_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ClientAck) Descriptor deprecated

func (*ClientAck) Descriptor() ([]byte, []int)

Deprecated: Use ClientAck.ProtoReflect.Descriptor instead.

func (*ClientAck) GetBatchId

func (x *ClientAck) GetBatchId() int64

func (*ClientAck) GetClientId

func (x *ClientAck) GetClientId() string

func (*ClientAck) GetDestination

func (x *ClientAck) GetDestination() string

func (*ClientAck) ProtoMessage

func (*ClientAck) ProtoMessage()

func (*ClientAck) ProtoReflect

func (x *ClientAck) ProtoReflect() protoreflect.Message

func (*ClientAck) Reset

func (x *ClientAck) Reset()

func (*ClientAck) String

func (x *ClientAck) String() string

type ClientAuth

type ClientAuth struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // hashed password with seeds from Handshake message
	// [default = 0]
	//
	// Types that are assignable to NetReadTimeoutPresent:
	//
	//	*ClientAuth_NetReadTimeout
	NetReadTimeoutPresent isClientAuth_NetReadTimeoutPresent `protobuf_oneof:"net_read_timeout_present"`
	// [default = 0];
	//
	// Types that are assignable to NetWriteTimeoutPresent:
	//
	//	*ClientAuth_NetWriteTimeout
	NetWriteTimeoutPresent isClientAuth_NetWriteTimeoutPresent `protobuf_oneof:"net_write_timeout_present"`
	Destination            string                              `protobuf:"bytes,5,opt,name=destination,proto3" json:"destination,omitempty"`
	ClientId               string                              `protobuf:"bytes,6,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	Filter                 string                              `protobuf:"bytes,7,opt,name=filter,proto3" json:"filter,omitempty"`
	StartTimestamp         int64                               `protobuf:"varint,8,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"`
	// contains filtered or unexported fields
}

client authentication

func (*ClientAuth) Descriptor deprecated

func (*ClientAuth) Descriptor() ([]byte, []int)

Deprecated: Use ClientAuth.ProtoReflect.Descriptor instead.

func (*ClientAuth) GetClientId

func (x *ClientAuth) GetClientId() string

func (*ClientAuth) GetDestination

func (x *ClientAuth) GetDestination() string

func (*ClientAuth) GetFilter

func (x *ClientAuth) GetFilter() string

func (*ClientAuth) GetNetReadTimeout

func (x *ClientAuth) GetNetReadTimeout() int32

func (*ClientAuth) GetNetReadTimeoutPresent

func (m *ClientAuth) GetNetReadTimeoutPresent() isClientAuth_NetReadTimeoutPresent

func (*ClientAuth) GetNetWriteTimeout

func (x *ClientAuth) GetNetWriteTimeout() int32

func (*ClientAuth) GetNetWriteTimeoutPresent

func (m *ClientAuth) GetNetWriteTimeoutPresent() isClientAuth_NetWriteTimeoutPresent

func (*ClientAuth) GetPassword

func (x *ClientAuth) GetPassword() []byte

func (*ClientAuth) GetStartTimestamp

func (x *ClientAuth) GetStartTimestamp() int64

func (*ClientAuth) GetUsername

func (x *ClientAuth) GetUsername() string

func (*ClientAuth) ProtoMessage

func (*ClientAuth) ProtoMessage()

func (*ClientAuth) ProtoReflect

func (x *ClientAuth) ProtoReflect() protoreflect.Message

func (*ClientAuth) Reset

func (x *ClientAuth) Reset()

func (*ClientAuth) String

func (x *ClientAuth) String() string

type ClientAuth_NetReadTimeout

type ClientAuth_NetReadTimeout struct {
	NetReadTimeout int32 `protobuf:"varint,3,opt,name=net_read_timeout,json=netReadTimeout,proto3,oneof"` // in seconds
}

type ClientAuth_NetWriteTimeout

type ClientAuth_NetWriteTimeout struct {
	NetWriteTimeout int32 `protobuf:"varint,4,opt,name=net_write_timeout,json=netWriteTimeout,proto3,oneof"` // in seconds
}

type ClientRollback

type ClientRollback struct {
	Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	BatchId     int64  `protobuf:"varint,3,opt,name=batch_id,json=batchId,proto3" json:"batch_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ClientRollback) Descriptor deprecated

func (*ClientRollback) Descriptor() ([]byte, []int)

Deprecated: Use ClientRollback.ProtoReflect.Descriptor instead.

func (*ClientRollback) GetBatchId

func (x *ClientRollback) GetBatchId() int64

func (*ClientRollback) GetClientId

func (x *ClientRollback) GetClientId() string

func (*ClientRollback) GetDestination

func (x *ClientRollback) GetDestination() string

func (*ClientRollback) ProtoMessage

func (*ClientRollback) ProtoMessage()

func (*ClientRollback) ProtoReflect

func (x *ClientRollback) ProtoReflect() protoreflect.Message

func (*ClientRollback) Reset

func (x *ClientRollback) Reset()

func (*ClientRollback) String

func (x *ClientRollback) String() string

type Compression

type Compression int32
const (
	Compression_COMPRESSIONCOMPATIBLEPROTO2 Compression = 0
	Compression_NONE                        Compression = 1
	Compression_ZLIB                        Compression = 2
	Compression_GZIP                        Compression = 3
	Compression_LZF                         Compression = 4
)

func (Compression) Descriptor

func (Compression) Enum

func (x Compression) Enum() *Compression

func (Compression) EnumDescriptor deprecated

func (Compression) EnumDescriptor() ([]byte, []int)

Deprecated: Use Compression.Descriptor instead.

func (Compression) Number

func (x Compression) Number() protoreflect.EnumNumber

func (Compression) String

func (x Compression) String() string

func (Compression) Type

type Dump

type Dump struct {
	Journal  string `protobuf:"bytes,1,opt,name=journal,proto3" json:"journal,omitempty"`
	Position int64  `protobuf:"varint,2,opt,name=position,proto3" json:"position,omitempty"`
	// [default = 0]
	//
	// Types that are assignable to TimestampPresent:
	//
	//	*Dump_Timestamp
	TimestampPresent isDump_TimestampPresent `protobuf_oneof:"timestamp_present"`
	// contains filtered or unexported fields
}

TBD when new packets are required

func (*Dump) Descriptor deprecated

func (*Dump) Descriptor() ([]byte, []int)

Deprecated: Use Dump.ProtoReflect.Descriptor instead.

func (*Dump) GetJournal

func (x *Dump) GetJournal() string

func (*Dump) GetPosition

func (x *Dump) GetPosition() int64

func (*Dump) GetTimestamp

func (x *Dump) GetTimestamp() int64

func (*Dump) GetTimestampPresent

func (m *Dump) GetTimestampPresent() isDump_TimestampPresent

func (*Dump) ProtoMessage

func (*Dump) ProtoMessage()

func (*Dump) ProtoReflect

func (x *Dump) ProtoReflect() protoreflect.Message

func (*Dump) Reset

func (x *Dump) Reset()

func (*Dump) String

func (x *Dump) String() string

type Dump_Timestamp

type Dump_Timestamp struct {
	Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3,oneof"`
}

type Get

type Get struct {
	Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	FetchSize   int32  `protobuf:"varint,3,opt,name=fetch_size,json=fetchSize,proto3" json:"fetch_size,omitempty"`
	// [default = -1]
	//
	// Types that are assignable to TimeoutPresent:
	//
	//	*Get_Timeout
	TimeoutPresent isGet_TimeoutPresent `protobuf_oneof:"timeout_present"`
	// [default = 2]
	//
	// Types that are assignable to UnitPresent:
	//
	//	*Get_Unit
	UnitPresent isGet_UnitPresent `protobuf_oneof:"unit_present"`
	// [default = false]
	//
	// Types that are assignable to AutoAckPresent:
	//
	//	*Get_AutoAck
	AutoAckPresent isGet_AutoAckPresent `protobuf_oneof:"auto_ack_present"`
	// contains filtered or unexported fields
}

PullRequest

func (*Get) Descriptor deprecated

func (*Get) Descriptor() ([]byte, []int)

Deprecated: Use Get.ProtoReflect.Descriptor instead.

func (*Get) GetAutoAck

func (x *Get) GetAutoAck() bool

func (*Get) GetAutoAckPresent

func (m *Get) GetAutoAckPresent() isGet_AutoAckPresent

func (*Get) GetClientId

func (x *Get) GetClientId() string

func (*Get) GetDestination

func (x *Get) GetDestination() string

func (*Get) GetFetchSize

func (x *Get) GetFetchSize() int32

func (*Get) GetTimeout

func (x *Get) GetTimeout() int64

func (*Get) GetTimeoutPresent

func (m *Get) GetTimeoutPresent() isGet_TimeoutPresent

func (*Get) GetUnit

func (x *Get) GetUnit() int32

func (*Get) GetUnitPresent

func (m *Get) GetUnitPresent() isGet_UnitPresent

func (*Get) ProtoMessage

func (*Get) ProtoMessage()

func (*Get) ProtoReflect

func (x *Get) ProtoReflect() protoreflect.Message

func (*Get) Reset

func (x *Get) Reset()

func (*Get) String

func (x *Get) String() string

type Get_AutoAck

type Get_AutoAck struct {
	AutoAck bool `protobuf:"varint,6,opt,name=auto_ack,json=autoAck,proto3,oneof"` // 是否自动ack
}

type Get_Timeout

type Get_Timeout struct {
	Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3,oneof"` // 默认-1时代表不控制
}

type Get_Unit

type Get_Unit struct {
	Unit int32 `protobuf:"varint,5,opt,name=unit,proto3,oneof"` // 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天
}

type Handshake

type Handshake struct {

	//	[default = "utf8"];
	//
	// Types that are assignable to CommunicationEncodingPresent:
	//
	//	*Handshake_CommunicationEncoding
	CommunicationEncodingPresent isHandshake_CommunicationEncodingPresent `protobuf_oneof:"communication_encoding_present"`
	Seeds                        []byte                                   `protobuf:"bytes,2,opt,name=seeds,proto3" json:"seeds,omitempty"`
	SupportedCompressions        Compression                              `` /* 182-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Handshake) Descriptor deprecated

func (*Handshake) Descriptor() ([]byte, []int)

Deprecated: Use Handshake.ProtoReflect.Descriptor instead.

func (*Handshake) GetCommunicationEncoding

func (x *Handshake) GetCommunicationEncoding() string

func (*Handshake) GetCommunicationEncodingPresent

func (m *Handshake) GetCommunicationEncodingPresent() isHandshake_CommunicationEncodingPresent

func (*Handshake) GetSeeds

func (x *Handshake) GetSeeds() []byte

func (*Handshake) GetSupportedCompressions

func (x *Handshake) GetSupportedCompressions() Compression

func (*Handshake) ProtoMessage

func (*Handshake) ProtoMessage()

func (*Handshake) ProtoReflect

func (x *Handshake) ProtoReflect() protoreflect.Message

func (*Handshake) Reset

func (x *Handshake) Reset()

func (*Handshake) String

func (x *Handshake) String() string

type Handshake_CommunicationEncoding

type Handshake_CommunicationEncoding struct {
	CommunicationEncoding string `protobuf:"bytes,1,opt,name=communication_encoding,json=communicationEncoding,proto3,oneof"`
}

type HeartBeat

type HeartBeat struct {
	SendTimestamp  int64 `protobuf:"varint,1,opt,name=send_timestamp,json=sendTimestamp,proto3" json:"send_timestamp,omitempty"`
	StartTimestamp int64 `protobuf:"varint,2,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*HeartBeat) Descriptor deprecated

func (*HeartBeat) Descriptor() ([]byte, []int)

Deprecated: Use HeartBeat.ProtoReflect.Descriptor instead.

func (*HeartBeat) GetSendTimestamp

func (x *HeartBeat) GetSendTimestamp() int64

func (*HeartBeat) GetStartTimestamp

func (x *HeartBeat) GetStartTimestamp() int64

func (*HeartBeat) ProtoMessage

func (*HeartBeat) ProtoMessage()

func (*HeartBeat) ProtoReflect

func (x *HeartBeat) ProtoReflect() protoreflect.Message

func (*HeartBeat) Reset

func (x *HeartBeat) Reset()

func (*HeartBeat) String

func (x *HeartBeat) String() string

type Messages

type Messages struct {
	BatchId  int64    `protobuf:"varint,1,opt,name=batch_id,json=batchId,proto3" json:"batch_id,omitempty"`
	Messages [][]byte `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

func (*Messages) Descriptor deprecated

func (*Messages) Descriptor() ([]byte, []int)

Deprecated: Use Messages.ProtoReflect.Descriptor instead.

func (*Messages) GetBatchId

func (x *Messages) GetBatchId() int64

func (*Messages) GetMessages

func (x *Messages) GetMessages() [][]byte

func (*Messages) ProtoMessage

func (*Messages) ProtoMessage()

func (*Messages) ProtoReflect

func (x *Messages) ProtoReflect() protoreflect.Message

func (*Messages) Reset

func (x *Messages) Reset()

func (*Messages) String

func (x *Messages) String() string

type Packet

type Packet struct {

	// [default = 17];
	//
	// Types that are assignable to MagicNumberPresent:
	//
	//	*Packet_MagicNumber
	MagicNumberPresent isPacket_MagicNumberPresent `protobuf_oneof:"magic_number_present"`
	// [default = 1];
	//
	// Types that are assignable to VersionPresent:
	//
	//	*Packet_Version
	VersionPresent isPacket_VersionPresent `protobuf_oneof:"version_present"`
	Type           PacketType              `protobuf:"varint,3,opt,name=type,proto3,enum=com.alibaba.otter.canal.protocol.packet.PacketType" json:"type,omitempty"`
	// [default = NONE];
	//
	// Types that are assignable to CompressionPresent:
	//
	//	*Packet_Compression
	CompressionPresent isPacket_CompressionPresent `protobuf_oneof:"compression_present"`
	Body               []byte                      `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*Packet) Descriptor deprecated

func (*Packet) Descriptor() ([]byte, []int)

Deprecated: Use Packet.ProtoReflect.Descriptor instead.

func (*Packet) GetBody

func (x *Packet) GetBody() []byte

func (*Packet) GetCompression

func (x *Packet) GetCompression() Compression

func (*Packet) GetCompressionPresent

func (m *Packet) GetCompressionPresent() isPacket_CompressionPresent

func (*Packet) GetMagicNumber

func (x *Packet) GetMagicNumber() int32

func (*Packet) GetMagicNumberPresent

func (m *Packet) GetMagicNumberPresent() isPacket_MagicNumberPresent

func (*Packet) GetType

func (x *Packet) GetType() PacketType

func (*Packet) GetVersion

func (x *Packet) GetVersion() int32

func (*Packet) GetVersionPresent

func (m *Packet) GetVersionPresent() isPacket_VersionPresent

func (*Packet) ProtoMessage

func (*Packet) ProtoMessage()

func (*Packet) ProtoReflect

func (x *Packet) ProtoReflect() protoreflect.Message

func (*Packet) Reset

func (x *Packet) Reset()

func (*Packet) String

func (x *Packet) String() string

type PacketType

type PacketType int32
const (
	// compatible
	PacketType_PACKAGETYPECOMPATIBLEPROTO2 PacketType = 0
	PacketType_HANDSHAKE                   PacketType = 1
	PacketType_CLIENTAUTHENTICATION        PacketType = 2
	PacketType_ACK                         PacketType = 3
	PacketType_SUBSCRIPTION                PacketType = 4
	PacketType_UNSUBSCRIPTION              PacketType = 5
	PacketType_GET                         PacketType = 6
	PacketType_MESSAGES                    PacketType = 7
	PacketType_CLIENTACK                   PacketType = 8
	// management part
	PacketType_SHUTDOWN PacketType = 9
	// integration
	PacketType_DUMP           PacketType = 10
	PacketType_HEARTBEAT      PacketType = 11
	PacketType_CLIENTROLLBACK PacketType = 12
)

func (PacketType) Descriptor

func (PacketType) Descriptor() protoreflect.EnumDescriptor

func (PacketType) Enum

func (x PacketType) Enum() *PacketType

func (PacketType) EnumDescriptor deprecated

func (PacketType) EnumDescriptor() ([]byte, []int)

Deprecated: Use PacketType.Descriptor instead.

func (PacketType) Number

func (x PacketType) Number() protoreflect.EnumNumber

func (PacketType) String

func (x PacketType) String() string

func (PacketType) Type

type Packet_Compression

type Packet_Compression struct {
	Compression Compression `protobuf:"varint,4,opt,name=compression,proto3,enum=com.alibaba.otter.canal.protocol.packet.Compression,oneof"`
}

type Packet_MagicNumber

type Packet_MagicNumber struct {
	MagicNumber int32 `protobuf:"varint,1,opt,name=magic_number,json=magicNumber,proto3,oneof"`
}

type Packet_Version

type Packet_Version struct {
	Version int32 `protobuf:"varint,2,opt,name=version,proto3,oneof"`
}

type Sub

type Sub struct {
	Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	Filter      string `protobuf:"bytes,7,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

subscription

func (*Sub) Descriptor deprecated

func (*Sub) Descriptor() ([]byte, []int)

Deprecated: Use Sub.ProtoReflect.Descriptor instead.

func (*Sub) GetClientId

func (x *Sub) GetClientId() string

func (*Sub) GetDestination

func (x *Sub) GetDestination() string

func (*Sub) GetFilter

func (x *Sub) GetFilter() string

func (*Sub) ProtoMessage

func (*Sub) ProtoMessage()

func (*Sub) ProtoReflect

func (x *Sub) ProtoReflect() protoreflect.Message

func (*Sub) Reset

func (x *Sub) Reset()

func (*Sub) String

func (x *Sub) String() string

type Unsub

type Unsub struct {
	Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
	ClientId    string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	Filter      string `protobuf:"bytes,7,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

Unsubscription

func (*Unsub) Descriptor deprecated

func (*Unsub) Descriptor() ([]byte, []int)

Deprecated: Use Unsub.ProtoReflect.Descriptor instead.

func (*Unsub) GetClientId

func (x *Unsub) GetClientId() string

func (*Unsub) GetDestination

func (x *Unsub) GetDestination() string

func (*Unsub) GetFilter

func (x *Unsub) GetFilter() string

func (*Unsub) ProtoMessage

func (*Unsub) ProtoMessage()

func (*Unsub) ProtoReflect

func (x *Unsub) ProtoReflect() protoreflect.Message

func (*Unsub) Reset

func (x *Unsub) Reset()

func (*Unsub) String

func (x *Unsub) String() string

Jump to

Keyboard shortcuts

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