Documentation ¶
Index ¶
- type StorageServer
- func (s *StorageServer) DeleteSession(sessionName string)
- func (s *StorageServer) GetLatestEvent(sessionName string) (*types.Event, error)
- func (s *StorageServer) GetSession(sessionName string) *types.Session
- func (s *StorageServer) StoreEvent(sessionName string, event *types.Event) error
- func (s *StorageServer) StoreSession(session *types.Session) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StorageServer ¶
type StorageServer struct {
// contains filtered or unexported fields
}
StorageServer is an in-memory implementation of a data store.
func NewStorageServer ¶
func NewStorageServer() *StorageServer
NewStorageServer constructs a new instance of StorageServer.
func (*StorageServer) DeleteSession ¶
func (s *StorageServer) DeleteSession(sessionName string)
DeleteSession deletes a session from the StorageServer.
func (*StorageServer) GetLatestEvent ¶
func (s *StorageServer) GetLatestEvent(sessionName string) (*types.Event, error)
GetLatestEvent returns the latest event associated with an existing session, and an error if the session does not exist.
func (*StorageServer) GetSession ¶
func (s *StorageServer) GetSession(sessionName string) *types.Session
GetSession retrieves an existing session from the StorageServer.
func (*StorageServer) StoreEvent ¶
func (s *StorageServer) StoreEvent(sessionName string, event *types.Event) error
StoreEvent stores an event associated with an existing session.
func (*StorageServer) StoreSession ¶
func (s *StorageServer) StoreSession(session *types.Session) error
StoreSession stores a session in the StorageServer.
type Store ¶
type Store interface { // Adds a Session object to the Store. StoreSession(session *types.Session) error // Retrieves an existing session from the Store. GetSession(sessionName string) *types.Session // Records an event and associates it to an existing session. StoreEvent(sessionName string, event *types.Event) error // Gets the latest event associated to an existing session, // and an error if the session does not exist. GetLatestEvent(sessionName string) (*types.Event, error) // Deletes a Session object and associated events from the // Store. DeleteSession(sessionName string) }
Store is the interface for a data store. The data store stores sessions and associated events.
Click to show internal directories.
Click to hide internal directories.