Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Del(keys ...string) error Get(key string, v interface{}) error IsNotFound(err error) bool Set(key string, v interface{}) error SetWithExpire(key string, v interface{}, expire time.Duration) error Take(v interface{}, key string, query func(v interface{}) error) error TakeWithExpire(v interface{}, key string, query func(v interface{}, expire time.Duration) error) error }
Cache interface is used to define the cache implementation.
func NewDefaultCache ¶
NewDefaultCache creates a default cache which is provided by go-zero.
type CachedConn ¶
type CachedConn interface { // Exec runs given exec on given keys, Exec(exec ExecFn, keys ...string) error // QueryRow unmarshals into v with given key and query func. QueryRow(v interface{}, query QueryFn, key string) error // SetCache sets v into cache with given key. SetCache(key string, v interface{}) error // DelCache deletes cache with keys. DelCache(keys ...string) error // GetCache unmarshals cache with given key into v. GetCache(key string, v interface{}) error }
A CachedConn is a DB connection with cache capability.
func NewDefaultCachedConn ¶
func NewDefaultCachedConn(cc Cache) CachedConn
NewDefaultCachedConn creates a cached conn.
Click to show internal directories.
Click to hide internal directories.