Documentation
¶
Index ¶
- Variables
- func AddToSet(ctx context.Context, key string, member string) error
- func Close(ctx context.Context) error
- func Delete(ctx context.Context, key string) error
- func DeleteFromHash(ctx context.Context, key string, field string) error
- func DeleteFromSet(ctx context.Context, key string, member string) error
- func Get(ctx context.Context, key string) ([]byte, error)
- func GetFromHash(ctx context.Context, key string, field string) ([]byte, error)
- func IsInSet(ctx context.Context, key string, member string) (bool, error)
- func Set(ctx context.Context, key string, value []byte, expire time.Duration) error
- func SetGlobalCache(c Cache)
- func SetToHash(ctx context.Context, key string, field string, value []byte) error
- type Cache
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DeleteFromHash ¶ added in v0.0.5
DeleteFromHash is wrapper for global cache.DeleteFromHash.
func DeleteFromSet ¶ added in v0.0.5
DeleteFromSet is wrapper for global cache.DeleteFromSet.
func GetFromHash ¶ added in v0.0.5
GetFromHash is wrapper for global cache.GetFromHash.
Types ¶
type Cache ¶
type Cache interface { Get(ctx context.Context, key string) ([]byte, error) Set(ctx context.Context, key string, value []byte, expire time.Duration) error Delete(ctx context.Context, key string) error IsInSet(ctx context.Context, key string, member string) (bool, error) AddToSet(ctx context.Context, key string, member string) error DeleteFromSet(ctx context.Context, key string, member string) error GetFromHash(ctx context.Context, key string, field string) ([]byte, error) SetToHash(ctx context.Context, key string, field string, value []byte) error DeleteFromHash(ctx context.Context, key string, field string) error Close(ctx context.Context) error }
func NewMemoryCache ¶
func NewMemoryCache() Cache
func NewRedisCache ¶
NewRedisCache creates a new redisCache instance.
Click to show internal directories.
Click to hide internal directories.