Documentation
¶
Index ¶
- func RetrieveEventSourcingClientUrl() string
- type EventSourcingHttpClient
- func (client *EventSourcingHttpClient) AddEvents(aggregateId string, events []models.ChangeTrackedEvent) error
- func (client *EventSourcingHttpClient) AddEventsWithoutValidation(aggregateId string, events []models.ChangeTrackedEvent) error
- func (client *EventSourcingHttpClient) GetEventsOrdered(aggregateId string) (*EventsIterator, error)
- func (client *EventSourcingHttpClient) GetEventsSince(eventId string, limit int) ([]models.Event, error)
- type EventsIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RetrieveEventSourcingClientUrl ¶ added in v0.4.5
func RetrieveEventSourcingClientUrl() string
Types ¶
type EventSourcingHttpClient ¶
type EventSourcingHttpClient struct {
// contains filtered or unexported fields
}
EventSourcingHttpClient is a client for interacting with the event sourcing HTTP API.
func NewEventSourcingHttpClient ¶
func NewEventSourcingHttpClient(urlStr string) (*EventSourcingHttpClient, error)
NewEventSourcingHttpClient creates a new EventSourcingHttpClient.
func (*EventSourcingHttpClient) AddEvents ¶
func (client *EventSourcingHttpClient) AddEvents(aggregateId string, events []models.ChangeTrackedEvent) error
AddEvents adds events to a given aggregate ID with validation.
func (*EventSourcingHttpClient) AddEventsWithoutValidation ¶
func (client *EventSourcingHttpClient) AddEventsWithoutValidation(aggregateId string, events []models.ChangeTrackedEvent) error
AddEventsWithoutValidation adds events to a given aggregate ID without validation.
func (*EventSourcingHttpClient) GetEventsOrdered ¶
func (client *EventSourcingHttpClient) GetEventsOrdered(aggregateId string) (*EventsIterator, error)
GetEventsOrdered retrieves events for a given aggregate ID in order.
func (*EventSourcingHttpClient) GetEventsSince ¶
func (client *EventSourcingHttpClient) GetEventsSince(eventId string, limit int) ([]models.Event, error)
GetEventsSince retrieves events since a given event ID with a limit.
type EventsIterator ¶
type EventsIterator struct {
// contains filtered or unexported fields
}
EventsIterator iterates over a list of events.
func NewEventIterator ¶
func NewEventIterator(events []models.Event) *EventsIterator
NewEventIterator creates a new EventsIterator.
func (*EventsIterator) Current ¶
func (e *EventsIterator) Current() *models.Event
Current returns the current event in the iterator.
func (*EventsIterator) Next ¶
func (e *EventsIterator) Next() (*models.Event, bool)
Next returns the next event in the iterator.
func (*EventsIterator) Reset ¶
func (e *EventsIterator) Reset()
Reset resets the iterator to the beginning.