pgoutbox

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSend = errors.New("error sending batch of outbox messages")

Functions

This section is empty.

Types

type App

type App struct {
	Name string
	*Outbox
}

func NewApp

func NewApp(conn pgclient.PGConnector, batcher Batcher, parser Parser, delayable bool) (*App, error)

func NewApps

func NewApps(envConfig OutboxConfig, parser Parser, sender Batcher, pgConfigs pgclient.ConfigSet) ([]*App, error)

func (*App) Run

func (a *App) Run(ctx context.Context) error

type Batcher

type Batcher interface {
	PublishBatch(ctx context.Context, messages []*messaging_pb.Message) ([]string, error)
}

type Outbox

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

func NewOutbox

func NewOutbox(connector pgConnector, publisher Batcher, parser Parser, delayable bool) (*Outbox, error)

func (*Outbox) Run

func (o *Outbox) Run(ctx context.Context) error

type OutboxConfig

type OutboxConfig struct {
	PostgresOutboxURI       []string `env:"POSTGRES_OUTBOX" default:""`
	PostgresOutboxDelayable bool     `env:"POSTGRES_OUTBOX_DELAYABLE" default:"false"`
}

type Parser

type Parser interface {
	ParseMessage(id string, data []byte) (*messaging_pb.Message, error)
}

Jump to

Keyboard shortcuts

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