Documentation
¶
Index ¶
- type Redis
- func (r *Redis) AddCache(key string, data any, expiration time.Duration) (string, error)
- func (r *Redis) CacheExists(key string) (bool, error)
- func (r *Redis) Connect() error
- func (r *Redis) Disconnect() error
- func (r *Redis) GetConfig() RedisConfig
- func (r *Redis) Init(database int) (*Redis, error)
- func (r *Redis) RemoveCache(key string) error
- func (r *Redis) RemoveKeyLock(key string) error
- func (r *Redis) RequestKeyLock(key string, expiration time.Duration) (bool, error)
- func (r *Redis) RetrieveCache(key string, result any) error
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis creates and manages the redis connection information
func (*Redis) CacheExists ¶
CacheExists retrieve an object from the cache
func (*Redis) RemoveCache ¶
RemoveCache inserts an object into the cache
func (*Redis) RemoveKeyLock ¶
RemoveKeyLock irequests to use a key for locking purposes Will return false if the key lock already exists
func (*Redis) RequestKeyLock ¶
RequestKeyLock irequests to use a key for locking purposes Will return false if the key lock already exists
type RedisConfig ¶
RedisConfig configuration structure for the redis connection
func (*RedisConfig) FromEnv ¶
func (r *RedisConfig) FromEnv() (*RedisConfig, error)
FromEnv creates a nats config using environmental variables
func (*RedisConfig) IsSet ¶
func (r *RedisConfig) IsSet() bool
IsSet checks if the configuration has been set Note: All fields required
Click to show internal directories.
Click to hide internal directories.