Documentation
¶
Index ¶
- Constants
- type Event
- type EventStoreSource
- func (s *EventStoreSource) Ack(ctx context.Context, msg hermod.Message) error
- func (s *EventStoreSource) Close() error
- func (s *EventStoreSource) GetState() map[string]string
- func (s *EventStoreSource) Ping(ctx context.Context) error
- func (s *EventStoreSource) Read(ctx context.Context) (hermod.Message, error)
- func (s *EventStoreSource) SetPollInterval(interval time.Duration)
- func (s *EventStoreSource) SetState(state map[string]string)
- func (s *EventStoreSource) SetStreamID(streamID string)
- type SQLStore
- func (s *SQLStore) Close() error
- func (s *SQLStore) Ping(ctx context.Context) error
- func (s *SQLStore) ReadAll(ctx context.Context, fromOffset int64, limit int, streamID string) ([]Event, error)
- func (s *SQLStore) SetLogger(logger hermod.Logger)
- func (s *SQLStore) SetTemplates(streamID, eventType string)
- func (s *SQLStore) Write(ctx context.Context, msg hermod.Message) error
- func (s *SQLStore) WriteBatch(ctx context.Context, msgs []hermod.Message) error
Constants ¶
View Source
const ( MetaExpectedVersion = "eventstore_expected_version" MetaStreamID = "eventstore_stream_id" MetaEventType = "eventstore_event_type" )
View Source
const ( QueryInitSchema = "InitSchema" QueryGetLastOffset = "GetLastOffset" QueryInsertEvent = "InsertEvent" QueryReadAll = "ReadAll" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
GlobalOffset int64 `json:"global_offset"`
StreamID string `json:"stream_id"`
StreamOffset int64 `json:"stream_offset"`
EventType string `json:"event_type"`
Payload []byte `json:"payload"`
Metadata map[string]string `json:"metadata"`
Timestamp time.Time `json:"timestamp"`
}
Event represents a single event in the event store.
type EventStoreSource ¶
type EventStoreSource struct {
// contains filtered or unexported fields
}
EventStoreSource implements hermod.Source for replaying events.
func NewEventStoreSource ¶
func NewEventStoreSource(store *SQLStore, fromOffset int64) *EventStoreSource
func (*EventStoreSource) Close ¶
func (s *EventStoreSource) Close() error
func (*EventStoreSource) GetState ¶
func (s *EventStoreSource) GetState() map[string]string
func (*EventStoreSource) SetPollInterval ¶
func (s *EventStoreSource) SetPollInterval(interval time.Duration)
func (*EventStoreSource) SetState ¶
func (s *EventStoreSource) SetState(state map[string]string)
func (*EventStoreSource) SetStreamID ¶
func (s *EventStoreSource) SetStreamID(streamID string)
Click to show internal directories.
Click to hide internal directories.