message

package
v0.0.0-...-330c09c Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int64CommandId

func Int64CommandId(id int64) []byte

Int64CommandId creates a command id from int64. Useful to use values like Generation as command id

func ParseAsyncCommandResult

func ParseAsyncCommandResult(data []byte) (interface{}, error)

Types

type AsyncCommand

type AsyncCommand interface {
	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
	SerializedId() []byte
}

AsyncCommand represents an interface of an asynchronous command containing an id. This type is used in order to automatically correlate commands and their results based on the id.

type AsyncCommandResult

type AsyncCommandResult struct {
	// CommandId is the command id
	CommandId []byte
	// Error is the eventual error string. Empty if no error happened
	Error string
}

AsyncCommandResult is a data structure representing an asynchronous command result. This can be used in use cases where the controller sends a command, which is acked as soon as is received by the data plane, then the data plane performs an eventually long operation, and when this operation is completed this result is sent back to the control plane. This can be used in conjunction with reconciler.AsyncCommandNotificationStore.

func (AsyncCommandResult) IsFailed

func (k AsyncCommandResult) IsFailed() bool

IsFailed returns true if this result contains an error

func (AsyncCommandResult) MarshalBinary

func (k AsyncCommandResult) MarshalBinary() (data []byte, err error)

func (*AsyncCommandResult) UnmarshalBinary

func (k *AsyncCommandResult) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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