recorder

package
v0.14.7 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRecord added in v0.14.7

type EventRecord struct {
	Event  eh.Event
	Status Status
	Err    error
}

EventRecord is a record for an event with additional metadata for status.

type EventStore

type EventStore struct {
	eh.EventStore
	// contains filtered or unexported fields
}

EventStore wraps an eventhorizon.EventStore and adds debug event recording.

func NewEventStore

func NewEventStore(eventStore eh.EventStore) *EventStore

NewEventStore creates a new EventStore.

func (*EventStore) FailedEvents added in v0.14.7

func (s *EventStore) FailedEvents() []eh.Event

FailedEvents returns the events that failed during the recording.

func (*EventStore) FullRecording added in v0.14.7

func (s *EventStore) FullRecording() []*EventRecord

FullRecording returns all events that happened during the recording, including status.

func (*EventStore) PendingEvents added in v0.14.7

func (s *EventStore) PendingEvents() []eh.Event

PendingEvents returns the events that where pending during the recording.

func (*EventStore) ResetTrace

func (s *EventStore) ResetTrace()

ResetTrace resets the record.

func (*EventStore) Save

func (s *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) error

Save implements the Save method of the eventhorizon.EventStore interface.

func (*EventStore) StartRecording

func (s *EventStore) StartRecording()

StartRecording starts recording of handled events.

func (*EventStore) StopRecording

func (s *EventStore) StopRecording()

StopRecording stops recording of handled events.

func (*EventStore) SuccessfulEvents added in v0.14.7

func (s *EventStore) SuccessfulEvents() []eh.Event

SuccessfulEvents returns the events that succeeded during the recording.

type Status added in v0.14.7

type Status int

Status is the status of the recorded event.

const (
	// Pending is for events that are being handled.
	Pending Status = iota
	// Succeeded is for events that was successfully saved (with potential side effects).
	Succeeded
	// Failed is for events that failed and where not saved.
	Failed
)

Jump to

Keyboard shortcuts

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