Documentation ¶
Overview ¶
Package memory provides the default in-memory session store.
Index ¶
- type MemoryStore
- func (s *MemoryStore) AddHistory(username, input, reply string)
- func (s *MemoryStore) Clear(username string)
- func (s *MemoryStore) ClearAll()
- func (s *MemoryStore) Freeze(username string) error
- func (s *MemoryStore) Get(username, name string) (string, error)
- func (s *MemoryStore) GetAll() map[string]*sessions.UserData
- func (s *MemoryStore) GetAny(username string) (*sessions.UserData, error)
- func (s *MemoryStore) GetHistory(username string) (*sessions.History, error)
- func (s *MemoryStore) GetLastMatch(username string) (string, error)
- func (s *MemoryStore) Init(username string) *sessions.UserData
- func (s *MemoryStore) Set(username string, vars map[string]string)
- func (s *MemoryStore) SetLastMatch(username, trigger string)
- func (s *MemoryStore) Thaw(username string, action sessions.ThawAction) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
Type MemoryStore implements the default in-memory session store for RiveScript.
func (*MemoryStore) AddHistory ¶
func (s *MemoryStore) AddHistory(username, input, reply string)
AddHistory adds history items.
func (*MemoryStore) ClearAll ¶
func (s *MemoryStore) ClearAll()
ClearAll resets all user data for all users.
func (*MemoryStore) Freeze ¶
func (s *MemoryStore) Freeze(username string) error
Freeze makes a snapshot of user variables.
func (*MemoryStore) Get ¶
func (s *MemoryStore) Get(username, name string) (string, error)
Get a user variable.
func (*MemoryStore) GetAll ¶
func (s *MemoryStore) GetAll() map[string]*sessions.UserData
GetAll gets all data for all users.
func (*MemoryStore) GetAny ¶
func (s *MemoryStore) GetAny(username string) (*sessions.UserData, error)
GetAny gets all variables for a user.
func (*MemoryStore) GetHistory ¶
func (s *MemoryStore) GetHistory(username string) (*sessions.History, error)
GetHistory gets the user's history.
func (*MemoryStore) GetLastMatch ¶
func (s *MemoryStore) GetLastMatch(username string) (string, error)
GetLastMatch returns the last matched trigger for the user,
func (*MemoryStore) Init ¶
func (s *MemoryStore) Init(username string) *sessions.UserData
init makes sure a username exists in the memory store.
func (*MemoryStore) Set ¶
func (s *MemoryStore) Set(username string, vars map[string]string)
Set a user variable.
func (*MemoryStore) SetLastMatch ¶
func (s *MemoryStore) SetLastMatch(username, trigger string)
SetLastMatch sets the user's last matched trigger.
func (*MemoryStore) Thaw ¶
func (s *MemoryStore) Thaw(username string, action sessions.ThawAction) error
Thaw restores from a snapshot.
Click to show internal directories.
Click to hide internal directories.