Documentation
¶
Index ¶
- type Clock
- type EntryStorage
- func (e *EntryStorage) ClaimEntries(_ context.Context, processorID string, claimDeadline time.Time) error
- func (e *EntryStorage) CountEntries() int
- func (e *EntryStorage) DeleteEntries(_ context.Context, entryIDs ...string) error
- func (e *EntryStorage) GetClaimedEntries(_ context.Context, processorID string, batchSize int) ([]outbox.ClaimedEntry, error)
- func (e *EntryStorage) Publish(ctx context.Context, _ interface{}, messages ...outbox.Message) error
- type PublishedMessage
- type Publisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntryStorage ¶
type EntryStorage struct { // Clock abstracts the time package Clock Clock // contains filtered or unexported fields }
EntryStorage is a simple fake implementation of two outbox interfaces:
- outbox.ProcessorStorage: for use directly by the outbox.Outbox to process Outbox ClaimedEntry objects
- outbox.Publisher: for applications to treat as the outbox.Outbox that records their messages during a transaction
func (*EntryStorage) ClaimEntries ¶
func (e *EntryStorage) ClaimEntries(_ context.Context, processorID string, claimDeadline time.Time) error
ClaimEntries implements outbox.ProcessorStorage interface
func (*EntryStorage) CountEntries ¶
func (e *EntryStorage) CountEntries() int
CountEntries is a test function for counting the number of entries currently in storage
func (*EntryStorage) DeleteEntries ¶
func (e *EntryStorage) DeleteEntries(_ context.Context, entryIDs ...string) error
DeleteEntries implements outbox.ProcessorStorage interface
func (*EntryStorage) GetClaimedEntries ¶
func (e *EntryStorage) GetClaimedEntries(_ context.Context, processorID string, batchSize int) ([]outbox.ClaimedEntry, error)
GetClaimedEntries implements outbox.ProcessorStorage interface
type PublishedMessage ¶ added in v0.4.0
type Publisher ¶
type Publisher struct { // Logger can be provided to receive log output Logger logr.Logger // contains filtered or unexported fields }
Publisher is a simple in-memory fake for publishing messages. As it doesn't actually deliver messages anywhere, even in-memory particularly, it's almost a mock instead of a fake, but it does function without configuration from the caller's point of view.
func (*Publisher) Clear ¶
func (p *Publisher) Clear() []PublishedMessage
Clear wipes the internal state of the Publisher as if nothing had ever been published. It returns the previously published Message objects for convenience.
func (*Publisher) GetPublished ¶
func (p *Publisher) GetPublished() []PublishedMessage
GetPublished retrieves a copy of the published messages
func (*Publisher) GetPublishedCount ¶
GetPublishedCount retrieves a count of published messages