Documentation ¶
Index ¶
- Constants
- Variables
- func NewMemcachedClient(url string) kv.Storage
- type Config
- type Plugin
- func (s *Plugin) Close() error
- func (s *Plugin) Delete(keys ...string) error
- func (s *Plugin) Get(key string) ([]byte, error)
- func (s *Plugin) Has(keys ...string) (map[string]bool, error)
- func (s *Plugin) Init(log logger.Logger, cfg config.Configurer) error
- func (s *Plugin) MExpire(items ...kv.Item) error
- func (s *Plugin) MGet(keys ...string) (map[string]interface{}, error)
- func (s *Plugin) Name() string
- func (s *Plugin) RPC() interface{}
- func (s *Plugin) Serve() chan error
- func (s *Plugin) Set(items ...kv.Item) error
- func (s *Plugin) Stop() error
- func (s *Plugin) TTL(keys ...string) (map[string]interface{}, error)
Constants ¶
const PluginName = "memcached"
Variables ¶
var EmptyItem = kv.Item{}
Functions ¶
func NewMemcachedClient ¶
NewMemcachedClient 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.
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 Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) 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 (*Plugin) 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.
func (*Plugin) Set ¶
Set sets the KV pairs. Keys should be 250 bytes maximum TTL: 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.