caches

package
v0.0.0-...-e7dc820 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 5 Imported by: 0

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 (mc *MemCache) AddSession(sessionId, userId string, expired time.Duration) error

func (*MemCache) DelSession

func (mc *MemCache) DelSession(sessionId string) error

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

Jump to

Keyboard shortcuts

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