message

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	// contains filtered or unexported fields
}

Message represents a pub/sub message with an associated codec.Codec.

func NewMessage

func NewMessage(codec codec.Codec, message *pubsub.Message) *Message

NewMessage returns a new Message instance.

func (*Message) Ack

func (m *Message) Ack()

Ack indicates the successful message processing. Calls to Ack or Nack have no effect after the first call.

func (*Message) Attributes

func (m *Message) Attributes() map[string]string

Attributes returns the base message attributes.

func (*Message) BaseMessage

func (m *Message) BaseMessage() *pubsub.Message

BaseMessage returns the base pubsub.Message.

func (*Message) Codec

func (m *Message) Codec() codec.Codec

Codec returns the associated codec.Codec.

func (*Message) Data

func (m *Message) Data() []byte

Data returns the base message data.

func (*Message) Decode

func (m *Message) Decode(out any) error

Decode decodes the message content into the provided parameter.

func (*Message) ID

func (m *Message) ID() string

ID returns the base message id.

func (*Message) Nack

func (m *Message) Nack()

Nack indicates that the client will not or cannot process the message. Calls to Ack or Nack have no effect after the first call.

Jump to

Keyboard shortcuts

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