Documentation ¶
Index ¶
Constants ¶
View Source
const LoggerTag = "EVENT_STORE"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
EventStore listens for event messages using the transport and stores them for later use.
func New ¶
func New(ctx context.Context, cfg Config) (*EventStore, error)
New returns a new instance of the EventStore struct.
func (*EventStore) Events ¶
Events returns events for the given type and index. The method is thread-safe.
func (*EventStore) Start ¶
func (e *EventStore) Start() error
func (*EventStore) Wait ¶
func (e *EventStore) Wait() chan error
Wait waits until the context is canceled or until an error occurs.
type Storage ¶
type Storage interface { // Add adds a message to the store. If the message already exists, it will // be updated if the MessageDate is newer. The method is thread-safe. Add(ctx context.Context, author []byte, evt *messages.Event) error // Get returns messages form the store for the given type and index. If the // message does not exist, nil will be returned. The method is thread-safe. Get(ctx context.Context, typ string, idx []byte) ([]*messages.Event, error) }
Storage provides an interface to the event storage mechanism.
Click to show internal directories.
Click to hide internal directories.