Documentation ¶
Index ¶
- Constants
- type Config
- type Driver
- func (d *Driver) Clear() error
- func (d *Driver) Delete(keys ...string) error
- func (d *Driver) Get(key string) ([]byte, error)
- func (d *Driver) Has(keys ...string) (map[string]bool, error)
- func (d *Driver) MExpire(items ...*kvv1.Item) error
- func (d *Driver) MGet(keys ...string) (map[string][]byte, error)
- func (d *Driver) Set(items ...*kvv1.Item) error
- func (d *Driver) TTL(_ ...string) (map[string]string, error)
- type Plugin
Constants ¶
View Source
const ( PluginName string = "memcached" RootPluginName string = "kv" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Addr is url for memcached, 11211 port is used by default Addr []string }
func (*Config) InitDefaults ¶
func (s *Config) InitDefaults()
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func NewMemcachedDriver ¶
func NewMemcachedDriver(log logger.Logger, key string, cfgPlugin config.Configurer) (*Driver, error)
NewMemcachedDriver returns a memcache client using the provided server(s) with equal weight. If a server is listed multiple times, it gets a proportional amount of weight.
func (*Driver) Get ¶
Get gets the item for the given key. ErrCacheMiss is returned for a memcache cache miss. The key must be at most 250 bytes in length.
func (*Driver) MExpire ¶
MExpire Expiration is the cache expiration time, in seconds: either a relative time from now (up to 1 month), or an absolute Unix epoch time. Zero means the Item has no expiration time.
Click to show internal directories.
Click to hide internal directories.