message

package
v0.0.0-...-79645f3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(msg *Message) error

type Message

type Message struct {
	ID       string   `json:"id"`
	Metadata Metadata `json:"metadata"`
	Payload  Payload  `json:"payload"`
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(ctx context.Context, UUID string, payload Payload) *Message

func (*Message) Ack

func (m *Message) Ack() bool

func (*Message) Context

func (m *Message) Context() context.Context

func (*Message) Copy

func (m *Message) Copy() *Message

func (*Message) Equals

func (m *Message) Equals(toCompare *Message) bool

Equals compare, that two messages are equal. Acks/Nacks are not compared.

func (*Message) Nack

func (m *Message) Nack() bool

func (*Message) SetContext

func (m *Message) SetContext(ctx context.Context) *Message

func (*Message) State

func (m *Message) State() State

func (*Message) StateChange

func (m *Message) StateChange() <-chan State

func (*Message) WithMetadata

func (m *Message) WithMetadata(key, value string) *Message

type Metadata

type Metadata map[string]string

type Payload

type Payload []byte

type State

type State int
const (
	Processing State = iota
	Ack
	Nack
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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