types

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForwardOutput added in v0.0.2

type ForwardOutput struct {
	Read         Messages
	PublishedIDs []int64
	AckedIDs     []int64
}

func (ForwardOutput) String added in v0.0.2

func (fs ForwardOutput) String() string

type Message

type Message struct {
	// ID is assigned by Postgres database after calling a Write method of outbox.Writer.
	ID int64

	// Broker is the name of the message broker, i.e. "kafka", "sns", etc.
	Broker string `validate:"required"`

	// Topic is the name or id (i.e. AWS ARN) of the message topic where the message will be published.
	Topic string `validate:"required"`

	// Metadata is optional map to implement outbox.Publisher interface more flexibly.
	Metadata map[string]string

	// Payload is the message body, ideally it should be published as is, but can be transformed in outbox.Publisher.
	Payload []byte `validate:"required,json"`
}

func (*Message) Validate

func (m *Message) Validate() error

type MessageFilter

type MessageFilter struct {
	Brokers []string
	Topics  []string
}

func (*MessageFilter) Validate

func (m *MessageFilter) Validate() error

type Messages

type Messages []Message

func (Messages) IDs

func (m Messages) IDs() []int64

func (Messages) Validate

func (m Messages) Validate() error

type ToMessageFunc

type ToMessageFunc[T any] func(entity T) (Message, error)

Jump to

Keyboard shortcuts

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