Documentation
¶
Index ¶
- func GetManager() *manager
- func NewError(err error) error
- func NewPingError(err error) error
- func NewReadError(key string, err error) error
- func NewWriteError(key string, value any, err error) error
- type Error
- type ICache
- type PingError
- type ReadError
- type RedisClientCache
- func (ins *RedisClientCache) Close() error
- func (ins *RedisClientCache) Get(ctx context.Context, key string, val any) error
- func (ins *RedisClientCache) GetStruct(ctx context.Context, key string, val any) error
- func (ins *RedisClientCache) HGet(ctx context.Context, key string, field string, val any) error
- func (ins *RedisClientCache) HSet(ctx context.Context, key string, expiration time.Duration, val ...any) error
- func (ins *RedisClientCache) Init(name string, configPrefix string, cachePrefix string) error
- func (ins *RedisClientCache) IsInitialized() bool
- func (ins *RedisClientCache) Ping(ctx context.Context) error
- func (ins *RedisClientCache) Set(ctx context.Context, key string, val any, expiration time.Duration) error
- func (ins *RedisClientCache) SetStruct(ctx context.Context, key string, val any, expiration time.Duration) error
- type WriteError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetManager ¶
func GetManager() *manager
GetManager - This function returns singleton instance of Cache Manager
func NewPingError ¶
NewPingError - return a new instance of PingError
func NewReadError ¶
NewReadError - return a new instance of ReadError
Types ¶
type ICache ¶
type ICache interface { Ping(ctx context.Context) error Init(name string, configPrefix string, cachePrefix string) error IsInitialized() bool Close() error Get(ctx context.Context, key string, val any) error Set(ctx context.Context, key string, val any, expiration time.Duration) error SetStruct(ctx context.Context, key string, val any, expiration time.Duration) error GetStruct(ctx context.Context, key string, val any) error HSet(ctx context.Context, key string, expiration time.Duration, val ...any) error HGet(ctx context.Context, key string, field string, val any) error }
ICache interface
type RedisClientCache ¶
type RedisClientCache struct {
// contains filtered or unexported fields
}
RedisClientCache object
func (*RedisClientCache) Close ¶
func (ins *RedisClientCache) Close() error
Close - It closes the connection.
func (*RedisClientCache) Init ¶
func (ins *RedisClientCache) Init(name string, configPrefix string, cachePrefix string) error
Init - Constructor: It reads the redis client configurations and initialize the connection
func (*RedisClientCache) IsInitialized ¶
func (ins *RedisClientCache) IsInitialized() bool
IsInitialized receiver - that return boolean value
func (*RedisClientCache) Ping ¶
func (ins *RedisClientCache) Ping(ctx context.Context) error
Ping - ping redis server
type WriteError ¶
WriteError struct
func (*WriteError) Error ¶
func (err *WriteError) Error() string
Error method - satisfying error interface
Click to show internal directories.
Click to hide internal directories.