Documentation ¶
Overview ¶
Wrapper for Memcached
Index ¶
- Constants
- Variables
- func Delete(key string) error
- func GetBytes(key string) ([]byte, bool, error)
- func GetFloat(key string) (float64, bool, error)
- func GetInt(key string) (int, bool, error)
- func GetObj(key string, dest interface{}) (bool, error)
- func GetSetBool(key string, getFn func() (bool, error), expire int32, flag ...uint32) (bool, error)
- func GetSetInt(key string, getFn func() (int, error), expire int32, flag ...uint32) (int, error)
- func GetSetObj(key string, dest interface{}, getFn func() (interface{}, error), expire int32, ...) error
- func GetSetString(key string, getFn func() (string, error), expire int32, flag ...uint32) (string, error)
- func GetString(key string) (string, bool, error)
- func SetBytes(key string, value []byte, expire int32, flag ...uint32) error
- func SetExpiration(dur time.Duration) int32
- func SetFloat(key string, value float64, expire int32, flag ...uint32) error
- func SetInt(key string, value int, expire int32, flag ...uint32) error
- func SetObj(key string, obj interface{}, expire int32, flag ...uint32) error
- func SetString(key, value string, expire int32, flag ...uint32) error
Constants ¶
View Source
const ( NothingFlag uint32 = 0 SnappyCompressFlag uint32 = 1 GzipCompressFlag uint32 = 2 )
Variables ¶
View Source
var ( // Predefined expiration time NoExpiration = 0 Expiration15m = int32((15 * time.Minute).Seconds()) Expiration1h = int32((time.Hour).Seconds()) Expiration24h = int32((24 * time.Hour).Seconds()) Expiration3d = int32((3 * 24 * time.Hour).Seconds()) Expiration30d = int32((30 * 24 * time.Hour).Seconds()) )
Functions ¶
func GetSetBool ¶
func GetSetObj ¶
func GetSetObj(key string, dest interface{}, getFn func() (interface{}, error), expire int32, flag ...uint32) error
GetSetObj gets object from cache and save it to dest pointer. If object not exists, get it from getFn and save to a cache.
func GetSetString ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.