messaging

package
v1.0.77 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: GPL-3.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message interface {
	GetError() error
	GetStatus() string
	GetCommand() string
	GetData() []byte
	GetOperationID() string
	SetOperationID(operationID string)
	Deserialize(message []byte) error
	Serialize() ([]byte, error)
}

func NewMessage added in v1.0.40

func NewMessage(operationID string, error error, status string, command string, data []byte) Message

NewMessage creates a new message

type MessageImpl added in v1.0.40

type MessageImpl struct {
	OperationID string `json:"operationID"`
	Command     string `json:"command"`
	Status      string `json:"status"`
	Error       error  `json:"error"`
	Data        []byte `json:"data"`
}

MessageImpl implements the Message interface

func (*MessageImpl) Deserialize added in v1.0.40

func (m *MessageImpl) Deserialize(message []byte) error

Deserializes a byte slice into Message

func (*MessageImpl) GetCommand added in v1.0.40

func (m *MessageImpl) GetCommand() string

GetCommand returns the command

func (*MessageImpl) GetData added in v1.0.40

func (m *MessageImpl) GetData() []byte

GetData returns the data

func (*MessageImpl) GetError added in v1.0.40

func (m *MessageImpl) GetError() error

GetError returns the error

func (*MessageImpl) GetOperationID added in v1.0.40

func (m *MessageImpl) GetOperationID() string

Get the operation ID

func (*MessageImpl) GetStatus added in v1.0.40

func (m *MessageImpl) GetStatus() string

GetStatus returns the status

func (*MessageImpl) Serialize added in v1.0.40

func (m *MessageImpl) Serialize() ([]byte, error)

Serializes a Message into a byte slice

func (*MessageImpl) SetOperationID added in v1.0.59

func (m *MessageImpl) SetOperationID(operationID string)

Set the operation ID

type MessagingSystem

type MessagingSystem interface {
	Publish(ctx context.Context, data Message) error
	Subscribe(ctx context.Context) (<-chan Message, context.CancelFunc, error)
	Close(ctx context.Context) error
}

Interface for messaging systems

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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