Documentation ¶
Overview ¶
Package memcache provides some utilities for memcache access
Index ¶
- func CacheResponse(name lazy.Value, h web.Handler) web.Handler
- func CacheResponseWithExpire(name lazy.Value, expire time.Duration, h web.Handler) web.Handler
- func CachedObjectWithExpiration(ctx context.Context, key string, expiration time.Duration, dst interface{}, ...) error
- func Delete(ctx context.Context, key string)
- func DeleteMulti(ctx context.Context, keys []string) error
- func Exists(ctx context.Context, key string) bool
- func Get(ctx context.Context, key string, dst interface{}) error
- func GetMulti(ctx context.Context, keys []string, dst interface{}) error
- func IsMemcacheError(e error) bool
- func RegisterCachableHeaderKeys(keys ...string)
- func Set(ctx context.Context, key string, value interface{}) error
- func SetMulti(ctx context.Context, keys []string, values interface{}) error
- func SetMultiWithExpire(ctx context.Context, keys []string, values interface{}, expire time.Duration) error
- func SetWithExpire(ctx context.Context, key string, value interface{}, expire time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheResponse ¶
CacheResponse wraps web.Handler to support cache
func CacheResponseWithExpire ¶
CacheResponseWithExpire wraps web.Handler to support cache
func CachedObjectWithExpiration ¶
func CachedObjectWithExpiration( ctx context.Context, key string, expiration time.Duration, dst interface{}, generator func() (interface{}, error), force bool, ) error
CachedObjectWithExpiration execute generator function and store the result with `key` and set the value into dst with expiration.
func DeleteMulti ¶
DeleteMulti deletes the multiple keys
func IsMemcacheError ¶
IsMemcacheError returns whether the error is by Memcache
func RegisterCachableHeaderKeys ¶
func RegisterCachableHeaderKeys(keys ...string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.