Documentation
¶
Index ¶
- Constants
- func KeyLocation(account, device string) string
- func KeyLocations(accounts ...string) []string
- func KeySession(channel string) string
- func NewRedisStorage(cli *redis.Client) kim.SessionStorage
- type RedisStorage
- func (r *RedisStorage) Add(session *pkt.Session) error
- func (r *RedisStorage) Delete(account string, channelId string) error
- func (r *RedisStorage) Get(channelId string) (*pkt.Session, error)
- func (r *RedisStorage) GetLocation(account string, device string) (*kim.Location, error)
- func (r *RedisStorage) GetLocations(accounts ...string) ([]*kim.Location, error)
Constants ¶
View Source
const (
LocationExpired = time.Hour * 48
)
Variables ¶
This section is empty.
Functions ¶
func KeyLocation ¶
func KeyLocations ¶
func KeySession ¶
func NewRedisStorage ¶
func NewRedisStorage(cli *redis.Client) kim.SessionStorage
Types ¶
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func (*RedisStorage) Delete ¶
func (r *RedisStorage) Delete(account string, channelId string) error
Delete a session
func (*RedisStorage) Get ¶
func (r *RedisStorage) Get(channelId string) (*pkt.Session, error)
GetByID get session by sessionID
func (*RedisStorage) GetLocation ¶
func (*RedisStorage) GetLocations ¶
func (r *RedisStorage) GetLocations(accounts ...string) ([]*kim.Location, error)
Click to show internal directories.
Click to hide internal directories.