outbox

package
v0.0.0-...-0de0edb Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	Kind() string
}

type Manager

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

func New

func New(
	cfg *config.Config,
	db *sqlx.DB,
	publisher Publisher,
	getter *trmsqlx.CtxGetter,
	logger logger.Logger,
) Manager

func (*Manager) Consume

func (m *Manager) Consume(ctx context.Context) error

TOFIX: refactor function.

func (*Manager) Publish

func (m *Manager) Publish(ctx context.Context, topic string, event Event) error

func (*Manager) Start

func (m *Manager) Start(ctx context.Context, lock *latch.CountDownLatch, options Options)

type Message

type Message struct {
	Kind    string
	Topic   string
	Payload []byte
}

type Options

type Options struct {
	Heartbeat time.Duration
}

type Publisher

type Publisher interface {
	Publish(ctx context.Context, event Message) error
}

Jump to

Keyboard shortcuts

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