outbox_processor

package
v0.0.0-...-1ffe831 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStorage

func NewStorage(tableName string, pool *pgxpool.Pool) *storage

Types

type KafkaProducer

type KafkaProducer interface {
	ProduceMessage(topic string, messageBytes []byte)
}

type Message

type Message struct {
	ID      int64  `db:"id"`
	Message string `db:"message"`
}

type Service

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

func New

func New(
	tableName string,
	topicName string,
	pool *pgxpool.Pool,
	producer KafkaProducer,
) *Service

func (*Service) Publish

func (s *Service) Publish(ctx context.Context)

type Storage

type Storage interface {
	ListOutboxMessages(ctx context.Context, limit uint64) ([]*Message, error)
	DeleteOutboxMessages(ctx context.Context, ids []int64) error
}

Jump to

Keyboard shortcuts

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