p2p

package
v0.0.0-...-4624acb Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCDCPeerToPeer        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCDCPeerToPeer          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCDCPeerToPeer = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ExitReason_name = map[int32]string{
	0: "UNKNOWN",
	1: "OK",
	2: "CONGESTED",
	3: "CAPTURE_SUICIDE",
	4: "STALE_CONNECTION",
	5: "DUPLICATE_CONNECTION",
	6: "CAPTURE_ID_MISMATCH",
}
View Source
var ExitReason_value = map[string]int32{
	"UNKNOWN":              0,
	"OK":                   1,
	"CONGESTED":            2,
	"CAPTURE_SUICIDE":      3,
	"STALE_CONNECTION":     4,
	"DUPLICATE_CONNECTION": 5,
	"CAPTURE_ID_MISMATCH":  6,
}

Functions

func RegisterCDCPeerToPeerServer

func RegisterCDCPeerToPeerServer(s *grpc.Server, srv CDCPeerToPeerServer)

Types

type Ack

type Ack struct {
	Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	// the sequence of an already processed message.
	// Must be monotonically increasing for a given topic and two given node processes.
	LastSeq int64 `protobuf:"varint,2,opt,name=last_seq,json=lastSeq,proto3" json:"last_seq,omitempty"`
}

func (*Ack) Descriptor

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

func (*Ack) GetLastSeq

func (m *Ack) GetLastSeq() int64

func (*Ack) GetTopic

func (m *Ack) GetTopic() string

func (*Ack) Marshal

func (m *Ack) Marshal() (dAtA []byte, err error)

func (*Ack) MarshalTo

func (m *Ack) MarshalTo(dAtA []byte) (int, error)

func (*Ack) MarshalToSizedBuffer

func (m *Ack) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) Reset

func (m *Ack) Reset()

func (*Ack) Size

func (m *Ack) Size() (n int)

func (*Ack) String

func (m *Ack) String() string

func (*Ack) Unmarshal

func (m *Ack) Unmarshal(dAtA []byte) error

func (*Ack) XXX_DiscardUnknown

func (m *Ack) XXX_DiscardUnknown()

func (*Ack) XXX_Marshal

func (m *Ack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Ack) XXX_Merge

func (m *Ack) XXX_Merge(src proto.Message)

func (*Ack) XXX_Size

func (m *Ack) XXX_Size() int

func (*Ack) XXX_Unmarshal

func (m *Ack) XXX_Unmarshal(b []byte) error

type CDCPeerToPeerClient

type CDCPeerToPeerClient interface {
	// A bidirectional stream from the sender (client) to the receiver (server)
	// The send direction is used to carry the serialized payload, and the
	// reply direction is used to receive ACKs (progress information) from the server.
	SendMessage(ctx context.Context, opts ...grpc.CallOption) (CDCPeerToPeer_SendMessageClient, error)
}

CDCPeerToPeerClient is the client API for CDCPeerToPeer service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewCDCPeerToPeerClient

func NewCDCPeerToPeerClient(cc *grpc.ClientConn) CDCPeerToPeerClient

type CDCPeerToPeerServer

type CDCPeerToPeerServer interface {
	// A bidirectional stream from the sender (client) to the receiver (server)
	// The send direction is used to carry the serialized payload, and the
	// reply direction is used to receive ACKs (progress information) from the server.
	SendMessage(CDCPeerToPeer_SendMessageServer) error
}

CDCPeerToPeerServer is the server API for CDCPeerToPeer service.

type CDCPeerToPeer_SendMessageClient

type CDCPeerToPeer_SendMessageClient interface {
	Send(*MessagePacket) error
	Recv() (*SendMessageResponse, error)
	grpc.ClientStream
}

type CDCPeerToPeer_SendMessageServer

type CDCPeerToPeer_SendMessageServer interface {
	Send(*SendMessageResponse) error
	Recv() (*MessagePacket, error)
	grpc.ServerStream
}

type ExitReason

type ExitReason int32
const (
	ExitReason_UNKNOWN              ExitReason = 0
	ExitReason_OK                   ExitReason = 1
	ExitReason_CONGESTED            ExitReason = 2
	ExitReason_CAPTURE_SUICIDE      ExitReason = 3
	ExitReason_STALE_CONNECTION     ExitReason = 4
	ExitReason_DUPLICATE_CONNECTION ExitReason = 5
	ExitReason_CAPTURE_ID_MISMATCH  ExitReason = 6
)

func (ExitReason) EnumDescriptor

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

func (ExitReason) String

func (x ExitReason) String() string

type MessageEntry

type MessageEntry struct {
	// topic is used to separate messages into order-guaranteed logical streams.
	Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	// serialized payload. The format and schema is defined by the business logic
	// using the peer-to-peer mechanism.
	Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// monotonically increase.
	Sequence int64 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"`
}

MessageEntry represents a single message.

func (*MessageEntry) Descriptor

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

func (*MessageEntry) GetContent

func (m *MessageEntry) GetContent() []byte

func (*MessageEntry) GetSequence

func (m *MessageEntry) GetSequence() int64

func (*MessageEntry) GetTopic

func (m *MessageEntry) GetTopic() string

func (*MessageEntry) Marshal

func (m *MessageEntry) Marshal() (dAtA []byte, err error)

func (*MessageEntry) MarshalTo

func (m *MessageEntry) MarshalTo(dAtA []byte) (int, error)

func (*MessageEntry) MarshalToSizedBuffer

func (m *MessageEntry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MessageEntry) ProtoMessage

func (*MessageEntry) ProtoMessage()

func (*MessageEntry) Reset

func (m *MessageEntry) Reset()

func (*MessageEntry) Size

func (m *MessageEntry) Size() (n int)

func (*MessageEntry) String

func (m *MessageEntry) String() string

func (*MessageEntry) Unmarshal

func (m *MessageEntry) Unmarshal(dAtA []byte) error

func (*MessageEntry) XXX_DiscardUnknown

func (m *MessageEntry) XXX_DiscardUnknown()

func (*MessageEntry) XXX_Marshal

func (m *MessageEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MessageEntry) XXX_Merge

func (m *MessageEntry) XXX_Merge(src proto.Message)

func (*MessageEntry) XXX_Size

func (m *MessageEntry) XXX_Size() int

func (*MessageEntry) XXX_Unmarshal

func (m *MessageEntry) XXX_Unmarshal(b []byte) error

type MessagePacket

type MessagePacket struct {
	Meta *StreamMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"`
	// multiple messages can be batched.
	Entries []*MessageEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"`
}

func (*MessagePacket) Descriptor

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

func (*MessagePacket) GetEntries

func (m *MessagePacket) GetEntries() []*MessageEntry

func (*MessagePacket) GetMeta

func (m *MessagePacket) GetMeta() *StreamMeta

func (*MessagePacket) Marshal

func (m *MessagePacket) Marshal() (dAtA []byte, err error)

func (*MessagePacket) MarshalTo

func (m *MessagePacket) MarshalTo(dAtA []byte) (int, error)

func (*MessagePacket) MarshalToSizedBuffer

func (m *MessagePacket) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MessagePacket) ProtoMessage

func (*MessagePacket) ProtoMessage()

func (*MessagePacket) Reset

func (m *MessagePacket) Reset()

func (*MessagePacket) Size

func (m *MessagePacket) Size() (n int)

func (*MessagePacket) String

func (m *MessagePacket) String() string

func (*MessagePacket) Unmarshal

func (m *MessagePacket) Unmarshal(dAtA []byte) error

func (*MessagePacket) XXX_DiscardUnknown

func (m *MessagePacket) XXX_DiscardUnknown()

func (*MessagePacket) XXX_Marshal

func (m *MessagePacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MessagePacket) XXX_Merge

func (m *MessagePacket) XXX_Merge(src proto.Message)

func (*MessagePacket) XXX_Size

func (m *MessagePacket) XXX_Size() int

func (*MessagePacket) XXX_Unmarshal

func (m *MessagePacket) XXX_Unmarshal(b []byte) error

type SendMessageResponse

type SendMessageResponse struct {
	Ack          []*Ack     `protobuf:"bytes,1,rep,name=ack,proto3" json:"ack,omitempty"`
	ExitReason   ExitReason `protobuf:"varint,2,opt,name=exit_reason,json=exitReason,proto3,enum=p2p.ExitReason" json:"exit_reason,omitempty"`
	ErrorMessage string     `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
}

func (*SendMessageResponse) Descriptor

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

func (*SendMessageResponse) GetAck

func (m *SendMessageResponse) GetAck() []*Ack

func (*SendMessageResponse) GetErrorMessage

func (m *SendMessageResponse) GetErrorMessage() string

func (*SendMessageResponse) GetExitReason

func (m *SendMessageResponse) GetExitReason() ExitReason

func (*SendMessageResponse) Marshal

func (m *SendMessageResponse) Marshal() (dAtA []byte, err error)

func (*SendMessageResponse) MarshalTo

func (m *SendMessageResponse) MarshalTo(dAtA []byte) (int, error)

func (*SendMessageResponse) MarshalToSizedBuffer

func (m *SendMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SendMessageResponse) ProtoMessage

func (*SendMessageResponse) ProtoMessage()

func (*SendMessageResponse) Reset

func (m *SendMessageResponse) Reset()

func (*SendMessageResponse) Size

func (m *SendMessageResponse) Size() (n int)

func (*SendMessageResponse) String

func (m *SendMessageResponse) String() string

func (*SendMessageResponse) Unmarshal

func (m *SendMessageResponse) Unmarshal(dAtA []byte) error

func (*SendMessageResponse) XXX_DiscardUnknown

func (m *SendMessageResponse) XXX_DiscardUnknown()

func (*SendMessageResponse) XXX_Marshal

func (m *SendMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SendMessageResponse) XXX_Merge

func (m *SendMessageResponse) XXX_Merge(src proto.Message)

func (*SendMessageResponse) XXX_Size

func (m *SendMessageResponse) XXX_Size() int

func (*SendMessageResponse) XXX_Unmarshal

func (m *SendMessageResponse) XXX_Unmarshal(b []byte) error

type StreamMeta

type StreamMeta struct {
	// fields required for correctness
	SenderId   string `protobuf:"bytes,1,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"`
	ReceiverId string `protobuf:"bytes,2,opt,name=receiver_id,json=receiverId,proto3" json:"receiver_id,omitempty"`
	Epoch      int64  `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty"`
	// fields required for compatibility check
	ClientVersion string `protobuf:"bytes,50,opt,name=client_version,json=clientVersion,proto3" json:"client_version,omitempty"`
	// fields for metrics, logging, debugging, etc.
	SenderAdvertisedAddr string `protobuf:"bytes,100,opt,name=sender_advertised_addr,json=senderAdvertisedAddr,proto3" json:"sender_advertised_addr,omitempty"`
}

Metadata associated with one client-server bidirectional stream.

func (*StreamMeta) Descriptor

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

func (*StreamMeta) GetClientVersion

func (m *StreamMeta) GetClientVersion() string

func (*StreamMeta) GetEpoch

func (m *StreamMeta) GetEpoch() int64

func (*StreamMeta) GetReceiverId

func (m *StreamMeta) GetReceiverId() string

func (*StreamMeta) GetSenderAdvertisedAddr

func (m *StreamMeta) GetSenderAdvertisedAddr() string

func (*StreamMeta) GetSenderId

func (m *StreamMeta) GetSenderId() string

func (*StreamMeta) Marshal

func (m *StreamMeta) Marshal() (dAtA []byte, err error)

func (*StreamMeta) MarshalTo

func (m *StreamMeta) MarshalTo(dAtA []byte) (int, error)

func (*StreamMeta) MarshalToSizedBuffer

func (m *StreamMeta) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StreamMeta) ProtoMessage

func (*StreamMeta) ProtoMessage()

func (*StreamMeta) Reset

func (m *StreamMeta) Reset()

func (*StreamMeta) Size

func (m *StreamMeta) Size() (n int)

func (*StreamMeta) String

func (m *StreamMeta) String() string

func (*StreamMeta) Unmarshal

func (m *StreamMeta) Unmarshal(dAtA []byte) error

func (*StreamMeta) XXX_DiscardUnknown

func (m *StreamMeta) XXX_DiscardUnknown()

func (*StreamMeta) XXX_Marshal

func (m *StreamMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StreamMeta) XXX_Merge

func (m *StreamMeta) XXX_Merge(src proto.Message)

func (*StreamMeta) XXX_Size

func (m *StreamMeta) XXX_Size() int

func (*StreamMeta) XXX_Unmarshal

func (m *StreamMeta) XXX_Unmarshal(b []byte) error

type UnimplementedCDCPeerToPeerServer

type UnimplementedCDCPeerToPeerServer struct {
}

UnimplementedCDCPeerToPeerServer can be embedded to have forward compatible implementations.

func (*UnimplementedCDCPeerToPeerServer) SendMessage

Jump to

Keyboard shortcuts

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