Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound not found ErrNotFound = errors.New("key not exists") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Get get value from cache with value Get(ctx context.Context, key string) ([]byte, error) // Set set value to the cache with key of ttl Set(ctx context.Context, key string, value []byte, expiration time.Duration) error // Delete clear item in the cache Delete(ctx context.Context, key string) error }
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache memory cache
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
RedisCache redis cache
func NewRedisCache ¶
func NewRedisCache(client *redis.Client) *RedisCache
NewRedisCache new redis cache
Click to show internal directories.
Click to hide internal directories.