Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMissingKeyCacheError ¶
func NewMissingKeyCacheError ¶
Types ¶
type FreeCacheInMemCacheClient ¶
type FreeCacheInMemCacheClient struct {
// contains filtered or unexported fields
}
FreeCacheInMemCacheClient is in-mem cache. it wraps freecache.Cache struct. For more information regarding this cache - "https://github.com/coocood/freecache".
func NewFreeCacheInMemCacheClient ¶
func NewFreeCacheInMemCacheClient(instrumentationProvider instrumentation.IInstrumentationProvider, cache wrappers.IFreeCacheInMemCacheWrapper) *FreeCacheInMemCacheClient
NewFreeCacheInMemCacheClient is constructor for FreeCacheInMemCacheClient.
type ICacheClient ¶
type ICacheClient interface { // Get gets a value from the cache. It returns error when key does not exist. Get(key string) (string, error) //Set sets new item in the cache. //Zero expiration means the key has no expiration time. // It returns error when there was a problem trying to set the key. Set(key string, value string, expiration time.Duration) error }
ICacheClient is a basic cache client interface.
type MissingKeyCacheError ¶
type MissingKeyCacheError struct {
// contains filtered or unexported fields
}
MissingKeyCacheError is error that represent that is returned when ICacheClient is missing key on get method.
func (*MissingKeyCacheError) Error ¶
func (err *MissingKeyCacheError) Error() string
type NegativeExpirationCacheError ¶
type NegativeExpirationCacheError struct {
// contains filtered or unexported fields
}
NegativeExpirationCacheError abstract class that implements negative expiration error
func (*NegativeExpirationCacheError) Error ¶
func (err *NegativeExpirationCacheError) Error() string
type RedisCacheClient ¶
type RedisCacheClient struct {
// contains filtered or unexported fields
}
RedisCacheClient redis cache client implements ICacheClient. It wraps go-redis client - "github.com/go-redis/redis".
func NewRedisCacheClient ¶
func NewRedisCacheClient(instrumentationProvider instrumentation.IInstrumentationProvider, redisBaseClient wrappers.IRedisBaseClientWrapper, retryPolicy retrypolicy.IRetryPolicy, cacheContext context.Context) *RedisCacheClient
NewRedisCacheClient is factory for RedisCacheClient
func (*RedisCacheClient) Get ¶
func (client *RedisCacheClient) Get(key string) (string, error)
Get gets a value from the redis cache. It returns error when key does not exist.
func (*RedisCacheClient) Ping ¶
func (client *RedisCacheClient) Ping() error