Documentation ¶
Index ¶
- func CreateClient(cfg config.RedisConfig, db int) (*redis.Client, error)
- type KeyValueService
- type SessionRepository
- func (s SessionRepository) Create(userID int, session userland.Session) (err error)
- func (s SessionRepository) DeleteBySessionID(userID int, sessionID string) (err error)
- func (s SessionRepository) DeleteExpiredSessions(userID int) (err error)
- func (s SessionRepository) DeleteOtherSessions(userID int, currentSessionID string) (deletedSessionIDs []string, err error)
- func (s SessionRepository) FindAllByUserID(userID int) (userland.Sessions, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClient ¶
CreateClient from RedisConfig and DB number
Types ¶
type KeyValueService ¶
type KeyValueService struct {
// contains filtered or unexported fields
}
KeyValueService implements userland.KeyValueService interface using redis
func NewKeyValueService ¶
func NewKeyValueService(redisClient *redis.Client) *KeyValueService
NewKeyValueService construct a new KeyValueService from redis client
func (KeyValueService) Delete ¶
func (c KeyValueService) Delete(key string) (err error)
Delete cache in bytes with key without expiration
func (KeyValueService) Get ¶
func (c KeyValueService) Get(key string) (result []byte, err error)
Get a cache in bytes from a key
type SessionRepository ¶
type SessionRepository struct {
// contains filtered or unexported fields
}
SessionRepository implements userland.SessionRepository interface using redis
func NewSessionRepository ¶
func NewSessionRepository(redisClient *redis.Client) *SessionRepository
NewSessionRepository construct a new SessionRepository from redis client
func (SessionRepository) Create ¶
func (s SessionRepository) Create(userID int, session userland.Session) (err error)
func (SessionRepository) DeleteBySessionID ¶
func (s SessionRepository) DeleteBySessionID(userID int, sessionID string) (err error)
func (SessionRepository) DeleteExpiredSessions ¶
func (s SessionRepository) DeleteExpiredSessions(userID int) (err error)
func (SessionRepository) DeleteOtherSessions ¶
func (s SessionRepository) DeleteOtherSessions(userID int, currentSessionID string) (deletedSessionIDs []string, err error)
func (SessionRepository) FindAllByUserID ¶
func (s SessionRepository) FindAllByUserID(userID int) (userland.Sessions, error)
Click to show internal directories.
Click to hide internal directories.