storage

package
v0.0.0-...-69995ca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocationExpired = time.Hour * 48
)

Variables

This section is empty.

Functions

func KeyLocation

func KeyLocation(account, device string) string

func KeyLocations

func KeyLocations(accounts ...string) []string

func KeySession

func KeySession(channel string) string

func NewRedisStorage

func NewRedisStorage(cli *redis.Client) kim.SessionStorage

Types

type RedisStorage

type RedisStorage struct {
	// contains filtered or unexported fields
}

func (*RedisStorage) Add

func (r *RedisStorage) Add(session *pkt.Session) error

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 (r *RedisStorage) GetLocation(account string, device string) (*kim.Location, error)

func (*RedisStorage) GetLocations

func (r *RedisStorage) GetLocations(accounts ...string) ([]*kim.Location, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL