internal

package
v1.66.6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal added in v1.62.0

func Marshal(payload any) ([]byte, error)

func Unmarshal added in v1.62.0

func Unmarshal(data []byte, holder any) error

Types

type AckID

type AckID any

AckID is the identifier of a message for purposes of acknowledgement.

type Message

type Message struct {
	// ID message identifier for recorded messages on the server.
	ID string

	// Body contains the content of the message.
	Body []byte

	// Metadata has key/value pairs describing the message.
	Metadata map[string]string
}

Message is data that moves around between client and server.

func (*Message) ByteSize

func (m *Message) ByteSize() int

ByteSize estimates the size in bytes of the message for the purpose of restricting batch sizes.

type Queue

type Queue interface {
	Send(ctx context.Context, ms ...*Message) error
	Receive(ctx context.Context, count int) ([]*Message, error)

	// Close cleans up any resources used by the Publisher.
	Close() error
}

type Subscriber

type Subscriber interface {
	Handle(ctx context.Context, ms *Message) error

	// Close cleans up any resources used by the Subscriber.
	Close() error
}

Jump to

Keyboard shortcuts

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