outbox

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultOutboxTableName = "event_outbox"

Variables

View Source
var (
	ErrEventIdInvalid = errors.New("event id invalid")
)

Functions

This section is empty.

Types

type EventEntity

type EventEntity struct {
	Id        sql.NullString `db:"id"`
	Topic     sql.NullString `db:"topic"`
	Payload   []byte         `db:"payload"`
	CreatedAt sql.NullTime   `db:"created_at"`
}

func (*EventEntity) ToSerializedEvent

func (ee *EventEntity) ToSerializedEvent() (*events.SerializedEvent, error)

type Options

type Options struct {
	TableName  string
	Serializer serialization.Serializer
}

type Outbox

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

func New

func New(options *Options) (*Outbox, error)

func (*Outbox) EmitEvent

func (o *Outbox) EmitEvent(ctx context.Context, tx *sqlx.Tx, event *events.EventSpec) (*events.EventID, error)

Jump to

Keyboard shortcuts

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