messages

package
v0.0.0-...-9d9fbe0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnWrapAddTableFilesRequest

func UnWrapAddTableFilesRequest(message *RPCMessage) (*pb.AddTableFilesRequest, error)

func UnWrapAddTableFilesResponse

func UnWrapAddTableFilesResponse(message *RPCMessage) (*pb.AddTableFilesResponse, error)

func UnWrapCommitRequest

func UnWrapCommitRequest(message *RPCMessage) (*pb.CommitRequest, error)

func UnWrapCommitResponse

func UnWrapCommitResponse(message *RPCMessage) (*pb.CommitResponse, error)

func UnWrapGetDownloadLocsRequest

func UnWrapGetDownloadLocsRequest(message *RPCMessage) (*pb.GetDownloadLocsRequest, error)

func UnWrapGetDownloadLocsResponse

func UnWrapGetDownloadLocsResponse(message *RPCMessage) (*pb.GetDownloadLocsResponse, error)

func UnWrapGetRepoMetadataRequest

func UnWrapGetRepoMetadataRequest(message *RPCMessage) (*pb.GetRepoMetadataRequest, error)

func UnWrapGetRepoMetadataResponse

func UnWrapGetRepoMetadataResponse(message *RPCMessage) (*pb.GetRepoMetadataResponse, error)

func UnWrapGetUploadLocsRequest

func UnWrapGetUploadLocsRequest(message *RPCMessage) (*pb.GetUploadLocsRequest, error)

func UnWrapGetUploadLocsResponse

func UnWrapGetUploadLocsResponse(message *RPCMessage) (*pb.GetUploadLocsResponse, error)

func UnWrapHasChunksRequest

func UnWrapHasChunksRequest(message *RPCMessage) (*pb.HasChunksRequest, error)

func UnWrapHasChunksResponse

func UnWrapHasChunksResponse(message *RPCMessage) (*pb.HasChunksResponse, error)

func UnWrapListTableFilesRequest

func UnWrapListTableFilesRequest(message *RPCMessage) (*pb.ListTableFilesRequest, error)

func UnWrapListTableFilesResponse

func UnWrapListTableFilesResponse(message *RPCMessage) (*pb.ListTableFilesResponse, error)

func UnWrapRebaseRequest

func UnWrapRebaseRequest(message *RPCMessage) (*pb.RebaseRequest, error)

func UnWrapRebaseResponse

func UnWrapRebaseResponse(message *RPCMessage) (*pb.RebaseResponse, error)

func UnWrapRefreshTableFileUrlRequest

func UnWrapRefreshTableFileUrlRequest(message *RPCMessage) (*pb.RefreshTableFileUrlRequest, error)

func UnWrapRefreshTableFileUrlResponse

func UnWrapRefreshTableFileUrlResponse(message *RPCMessage) (*pb.RefreshTableFileUrlResponse, error)

func UnWrapRootRequest

func UnWrapRootRequest(message *RPCMessage) (*pb.RootRequest, error)

func UnWrapRootResponse

func UnWrapRootResponse(message *RPCMessage) (*pb.RootResponse, error)

func UnWrapStreamingDownloadLocsRequest

func UnWrapStreamingDownloadLocsRequest(message *RPCMessage) (*pb.GetDownloadLocsRequest, error)

func UnWrapStreamingDownloadLocsResponse

func UnWrapStreamingDownloadLocsResponse(message *RPCMessage) (*pb.GetDownloadLocsResponse, error)

Types

type ChunkMessage

type ChunkMessage struct {
	// The Body type indicates what is to be expected for kind of message
	PayloadType ChunkPayloadType

	// If receiving this message, this message is the last in a row of
	// adjacent requests/responses
	EndOfTx bool

	// The Body contains the body of the request or response
	Body []byte

	// The URL contains the URL of the request or response, as a string
	URL string

	// Additional necessary Headers are send alongside the message and passed through
	Headers map[string]string

	// Since requests and responses are send across two topics, they do not
	// need to be in order. Therefore, it is important to reconstruct the
	// order by tracking the original request and match it with a response when
	// it has arrived.
	ID MessageID
}

func NewResponseChunkMessage

func NewResponseChunkMessage(
	payloadType ChunkPayloadType,
	body []byte,
	headers map[string]string,
	id MessageID) *ChunkMessage

func NewTrackedChunkMessage

func NewTrackedChunkMessage(
	payloadType ChunkPayloadType,
	body []byte,
	url string,
	headers map[string]string) *ChunkMessage

func (*ChunkMessage) Encode

func (m *ChunkMessage) Encode() ([]byte, error)

func (*ChunkMessage) EndOfTransaction

func (m *ChunkMessage) EndOfTransaction() bool

func (*ChunkMessage) Identifier

func (m *ChunkMessage) Identifier() MessageID

func (*ChunkMessage) String

func (m *ChunkMessage) String() string

func (*ChunkMessage) Type

func (m *ChunkMessage) Type() MessageType

type ChunkPayloadType

type ChunkPayloadType uint8
const (
	RequestDownload ChunkPayloadType = iota
	RequestUpload
)

func (*ChunkPayloadType) String

func (t *ChunkPayloadType) String() string

type Message

type Message interface {
	fmt.Stringer
	Identifier() MessageID
	Type() MessageType
	Encode() ([]byte, error)
	EndOfTransaction() bool
}

func Decode

func Decode(encoded []byte) (Message, error)

type MessageID

type MessageID uuid.UUID

func NewMessageID

func NewMessageID() MessageID

func (*MessageID) String

func (m *MessageID) String() string

type MessageType

type MessageType uint8
const (
	RPC MessageType = iota
	Chunk
)

type RPCMessage

type RPCMessage struct {
	// The Payload type indicates what is to be expected for kind of message
	PayloadType RPCPayloadType

	// If receiving this message, this message is the last in a row of
	// adjacent requests/responses
	EndOfTx bool

	// The Payload contains the actual message
	Payload []byte

	// Since requests and responses are send across two topics, they do not
	// need to be in order. Therefore, it is important to reconstruct the
	// order by tracking the original request and match it with a response when
	// it has arrived.
	ID MessageID
}

func NewResponseRPCMessage

func NewResponseRPCMessage(payloadType RPCPayloadType, payload []byte, id MessageID) *RPCMessage

func NewStreamingRPCMessage

func NewStreamingRPCMessage(payloadType RPCPayloadType, payload []byte, id MessageID) *RPCMessage

func NewStreamingRPCMessageEndTransmission

func NewStreamingRPCMessageEndTransmission(payloadType RPCPayloadType, id MessageID) *RPCMessage

func NewTrackedRPCMessage

func NewTrackedRPCMessage(payloadType RPCPayloadType, payload []byte) *RPCMessage

func WrapAddTableFilesRequest

func WrapAddTableFilesRequest(in *pb.AddTableFilesRequest) (*RPCMessage, error)

func WrapAddTableFilesResponse

func WrapAddTableFilesResponse(in *pb.AddTableFilesResponse, id MessageID) (*RPCMessage, error)

func WrapCommitRequest

func WrapCommitRequest(in *pb.CommitRequest) (*RPCMessage, error)

func WrapCommitResponse

func WrapCommitResponse(in *pb.CommitResponse, id MessageID) (*RPCMessage, error)

func WrapGetDownloadLocsRequest

func WrapGetDownloadLocsRequest(in *pb.GetDownloadLocsRequest) (*RPCMessage, error)

func WrapGetDownloadLocsResponse

func WrapGetDownloadLocsResponse(in *pb.GetDownloadLocsResponse, id MessageID) (*RPCMessage, error)

func WrapGetRepoMetadataRequest

func WrapGetRepoMetadataRequest(in *pb.GetRepoMetadataRequest) (*RPCMessage, error)

func WrapGetRepoMetadataResponse

func WrapGetRepoMetadataResponse(in *pb.GetRepoMetadataResponse, id MessageID) (*RPCMessage, error)

func WrapGetUploadLocsRequest

func WrapGetUploadLocsRequest(in *pb.GetUploadLocsRequest) (*RPCMessage, error)

func WrapGetUploadLocsResponse

func WrapGetUploadLocsResponse(in *pb.GetUploadLocsResponse, id MessageID) (*RPCMessage, error)

func WrapHasChunksRequest

func WrapHasChunksRequest(in *pb.HasChunksRequest) (*RPCMessage, error)

func WrapHasChunksResponse

func WrapHasChunksResponse(in *pb.HasChunksResponse, id MessageID) (*RPCMessage, error)

func WrapListTableFilesRequest

func WrapListTableFilesRequest(in *pb.ListTableFilesRequest) (*RPCMessage, error)

func WrapListTableFilesResponse

func WrapListTableFilesResponse(in *pb.ListTableFilesResponse, id MessageID) (*RPCMessage, error)

func WrapRebaseRequest

func WrapRebaseRequest(in *pb.RebaseRequest) (*RPCMessage, error)

func WrapRebaseResponse

func WrapRebaseResponse(in *pb.RebaseResponse, id MessageID) (*RPCMessage, error)

func WrapRefreshTableFileUrlRequest

func WrapRefreshTableFileUrlRequest(in *pb.RefreshTableFileUrlRequest) (*RPCMessage, error)

func WrapRefreshTableFileUrlResponse

func WrapRefreshTableFileUrlResponse(in *pb.RefreshTableFileUrlResponse, id MessageID) (*RPCMessage, error)

func WrapRootRequest

func WrapRootRequest(in *pb.RootRequest) (*RPCMessage, error)

func WrapRootResponse

func WrapRootResponse(in *pb.RootResponse, id MessageID) (*RPCMessage, error)

func WrapStreamingDownloadLocsRequest

func WrapStreamingDownloadLocsRequest(in *pb.GetDownloadLocsRequest, id MessageID) (*RPCMessage, error)

func WrapStreamingDownloadLocsResponse

func WrapStreamingDownloadLocsResponse(in *pb.GetDownloadLocsResponse, id MessageID) (*RPCMessage, error)

func (*RPCMessage) Encode

func (m *RPCMessage) Encode() ([]byte, error)

func (*RPCMessage) EndOfTransaction

func (m *RPCMessage) EndOfTransaction() bool

func (*RPCMessage) Identifier

func (m *RPCMessage) Identifier() MessageID

func (*RPCMessage) String

func (m *RPCMessage) String() string

func (*RPCMessage) Type

func (m *RPCMessage) Type() MessageType

type RPCPayloadType

type RPCPayloadType uint8
const (
	GetRepoMetadata RPCPayloadType = iota
	HasChunks
	GetDownloadLocations
	StreamDownloadLocations
	GetUploadLocations
	Rebase
	Root
	Commit
	ListTableFiles
	RefreshTableFileUrl
	AddTableFiles
)

func (*RPCPayloadType) String

func (t *RPCPayloadType) String() string

Jump to

Keyboard shortcuts

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