Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHistoryService ¶
type EventHistoryService struct {
// contains filtered or unexported fields
}
EventHistoryService is the service responsible for event history
func NewEventHistoryService ¶
func NewEventHistoryService(cfg *config.Config, consumer events.Consumer, store store.Store, log log.Logger) (*EventHistoryService, error)
NewEventHistoryService returns an EventHistory service
func (*EventHistoryService) GetEvents ¶
func (eh *EventHistoryService) GetEvents(ctx context.Context, req *ehsvc.GetEventsRequest, resp *ehsvc.GetEventsResponse) error
GetEvents allows retrieving events from the eventstore by id
func (*EventHistoryService) GetEventsForUser ¶
func (eh *EventHistoryService) GetEventsForUser(ctx context.Context, req *ehsvc.GetEventsForUserRequest, resp *ehsvc.GetEventsResponse) error
GetEventsForUser allows retrieving events from the eventstore by userID This function will match all events that contains the user ID between two non-word characters. The reasoning behind this is that events put the userID in many different fields, which can differ per event type. This function will match all events that contain the userID by using a regex. This should also cover future events that might contain the userID in a different field.
func (*EventHistoryService) StoreEvents ¶
func (eh *EventHistoryService) StoreEvents()
StoreEvents consumes all events and stores them in the store. Will block
type StoreEvent ¶
StoreEvent is data structure in the store