Documentation ¶
Index ¶
- Constants
- type Config
- type Redis
- func (r *Redis) Close()
- func (r *Redis) Connect() error
- func (r *Redis) CreateForceLogoutKeys(duration time.Duration, jwtTokens ...string) error
- func (r *Redis) Del(key string) error
- func (r *Redis) DelByKeysPattern(match string) error
- func (r *Redis) DelByPattern(match string) error
- func (r *Redis) DelMany(keys []string) error
- func (r *Redis) DelManyFormattedKeys(keys []string) error
- func (r *Redis) Exist(key string) (bool, error)
- func (r *Redis) FlushAll() error
- func (r *Redis) Get(key string) (string, error)
- func (r *Redis) MSet(keys []string, values []interface{}, duration time.Duration) error
- func (r *Redis) Scan(match string) ([]string, error)
- func (r *Redis) Set(key, value string, duration time.Duration) error
Constants ¶
View Source
const ( CacheTtl5s = time.Second * 5 CacheTtl10s = time.Second * 10 CacheTtl15s = time.Second * 15 CacheTtl30s = time.Second * 30 CacheTtl1m = time.Minute CacheTtl2m = time.Minute * 2 CacheTtl5m = time.Minute * 5 CacheTtl10m = time.Minute * 10 CacheTtl15m = time.Minute * 15 CacheTtl30m = time.Minute * 30 CacheTtl1h = time.Hour CacheTtl3h = time.Hour * 3 CacheTtl6h = time.Hour * 6 CacheTtl9h = time.Hour * 9 CacheTtl12h = time.Hour * 12 CacheTtl1d = time.Hour * 24 CacheTtl2d = CacheTtl1d * 2 CacheTtl3d = CacheTtl1d * 3 CacheTtl4d = CacheTtl1d * 4 CacheTtl7d = CacheTtl1d * 7 CacheTtl9d = CacheTtl1d * 9 CacheTtl10d = CacheTtl1d * 10 CacheTtl15d = CacheTtl1d * 15 CacheTtl30d = CacheTtl1d * 30 )
View Source
const ( KeyNotFound = "key not found" ErrorClearCache = "fail to clean cache %s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface { GetHost() string GetPort() int GetUser() string GetPassword() string GetDatabase() string }
Config Interface With Methods to be a database config
type Redis ¶
type Redis struct { Client *redisClient.Client // contains filtered or unexported fields }
Redis struct to manage redis.
func (*Redis) CreateForceLogoutKeys ¶ added in v1.0.37
CreateForceLogoutKeys cria as chaves que serão inseridas no cache e que devem forçar o logout do usuário em outros dispositivos
func (*Redis) DelByKeysPattern ¶
DelByKeysPattern DO NOT USE THIS METHOD unless you're absolutely sure about what you're doing! it gets redis keys based on a match pattern using Keys() method and then, using DelMany(), removes these keys from redis cache
func (*Redis) DelByPattern ¶
DelByPattern gets redis keys based on a match pattern using Scan() method and then, using DelMany(), removes these keys from redis cache
func (*Redis) DelManyFormattedKeys ¶ added in v1.0.14
DelManyFormattedKeys remove várias chaves já formatadas com o nome do serviço
Click to show internal directories.
Click to hide internal directories.