Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSession = errors.New("no session found")
Functions ¶
This section is empty.
Types ¶
type CacheInterface ¶
type CacheInterface interface { AddSession(sessionId, userId string, expired time.Duration) error DelSession(sessionId string) error }
var Cache CacheInterface
type MemCache ¶
type MemCache struct {
// contains filtered or unexported fields
}
func NewMemCache ¶
func NewMemCache() *MemCache
func (*MemCache) AddSession ¶
func (*MemCache) DelSession ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache(options *redis.Options) *RedisCache
func (*RedisCache) AddSession ¶
func (rc *RedisCache) AddSession(sessionId, userId string, expired time.Duration) error
func (*RedisCache) DelSession ¶
func (rc *RedisCache) DelSession(sessionId string) error
Click to show internal directories.
Click to hide internal directories.