service

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

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

GetEvents allows retrieving events from the eventstore by id

func (*EventHistoryService) GetEventsForUser

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

type StoreEvent struct {
	ID    string
	Type  string
	Event []byte
}

StoreEvent is data structure in the store

Jump to

Keyboard shortcuts

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