outbox

package
v0.0.0-...-7e31de2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidOutboxStatus = errors.New("not a valid OutboxStatus")

Functions

This section is empty.

Types

type Outbox

type Outbox struct {
	ID        uint64
	Payload   string
	Topic     string
	Status    string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type OutboxService

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

func NewOutboxService

func NewOutboxService(
	logger *slog.Logger,
	eventBus eventBus,
	outboxRepo outboxRepo,
) *OutboxService

func (OutboxService) ProduceMessages

func (svc OutboxService) ProduceMessages(ctx context.Context) error

func (OutboxService) RevertPending

func (svc OutboxService) RevertPending(ctx context.Context) error

type OutboxStatus

type OutboxStatus string

ENUM(

READY = "READY"
SENDING = "SENDING"
SENT = "SENT"

)

const (
	// READY is a OutboxStatus of type READY.
	READY OutboxStatus = "READY"
	// SENDING is a OutboxStatus of type SENDING.
	SENDING OutboxStatus = "SENDING"
	// SENT is a OutboxStatus of type SENT.
	SENT OutboxStatus = "SENT"
)

func ParseOutboxStatus

func ParseOutboxStatus(name string) (OutboxStatus, error)

ParseOutboxStatus attempts to convert a string to a OutboxStatus.

func (OutboxStatus) IsValid

func (x OutboxStatus) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (OutboxStatus) MarshalText

func (x OutboxStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (OutboxStatus) String

func (x OutboxStatus) String() string

String implements the Stringer interface.

func (*OutboxStatus) UnmarshalText

func (x *OutboxStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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