Documentation
¶
Overview ¶
Package storage provides ability to transfer sessions user data to/from memory/disk storage
Index ¶
- type JSONSessionStorage
- func (ss *JSONSessionStorage) GetUsers(communicationType string, channelID string) usermanager.UserList
- func (ss *JSONSessionStorage) Load() error
- func (ss *JSONSessionStorage) Save() error
- func (ss *JSONSessionStorage) SetUsers(communicationType string, channelID string, users usermanager.UserList)
- type PersistentSessionStorage
- type SessionStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONSessionStorage ¶
type JSONSessionStorage struct {
// contains filtered or unexported fields
}
JSONSessionStorage stores user session in file in json format.
func NewJSONSessionData ¶
func NewJSONSessionData(filePath string) *JSONSessionStorage
NewJSONSessionData creates new storage.
func (*JSONSessionStorage) GetUsers ¶
func (ss *JSONSessionStorage) GetUsers(communicationType string, channelID string) usermanager.UserList
GetUsers returns UserList for given message processor.
func (*JSONSessionStorage) Load ¶
func (ss *JSONSessionStorage) Load() error
Load reads sessions data from disk.
func (*JSONSessionStorage) Save ¶
func (ss *JSONSessionStorage) Save() error
Save writes sessions data to disk.
func (*JSONSessionStorage) SetUsers ¶
func (ss *JSONSessionStorage) SetUsers(communicationType string, channelID string, users usermanager.UserList)
SetUsers sets UserList for given message processor.
type PersistentSessionStorage ¶
type PersistentSessionStorage interface { Load() error Save() error SessionStorage }
PersistentSessionStorage allows to dump data from memory to some persistent storage.
type SessionStorage ¶
type SessionStorage interface { GetUsers(communicationType string, channelID string) usermanager.UserList SetUsers(communicationType string, channelID string, users usermanager.UserList) }
SessionStorage getters and setters for users data.
Click to show internal directories.
Click to hide internal directories.