Documentation
¶
Index ¶
- Constants
- type RedisStorage
- func (csm *RedisStorage) Flush()
- func (csm *RedisStorage) Get(sessionID int64) (string, map[string]interface{})
- func (csm *RedisStorage) GetData(sessionID int64) map[string]interface{}
- func (csm *RedisStorage) Reset(sessionID int64)
- func (csm *RedisStorage) Set(sessionID int64, state string)
- func (csm *RedisStorage) SetData(sessionID int64, data map[string]interface{})
- func (csm *RedisStorage) UpdateState(sessionID int64, state string) map[string]interface{}
Constants ¶
View Source
const ( DefaultExpirationTime int64 = 0 // records won't expire RecordPrefix string = "user_data" // prefix for redis records InitialState string = "~" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisStorage ¶
func (*RedisStorage) Flush ¶
func (csm *RedisStorage) Flush()
remove all stored data and database (flush db)
func (*RedisStorage) Get ¶
func (csm *RedisStorage) Get(sessionID int64) (string, map[string]interface{})
func (*RedisStorage) GetData ¶
func (csm *RedisStorage) GetData(sessionID int64) map[string]interface{}
get user's saved data if no user found - will create new bucket
func (*RedisStorage) Set ¶
func (csm *RedisStorage) Set(sessionID int64, state string)
TODO: discuss if __state__ key must be array of database and renamed to __states__
func (*RedisStorage) SetData ¶
func (csm *RedisStorage) SetData(sessionID int64, data map[string]interface{})
update data bucket
func (*RedisStorage) UpdateState ¶
func (csm *RedisStorage) UpdateState(sessionID int64, state string) map[string]interface{}
sets new state TODO: discuss if __state__ key must be array of database and renamed to __states__
Click to show internal directories.
Click to hide internal directories.