Add memcache implementation of cache (#1848)
This commit is contained in:
12
cache/cache.go
vendored
12
cache/cache.go
vendored
@@ -1,6 +1,7 @@
|
||||
// Package cache is a caching interface
|
||||
package cache
|
||||
|
||||
// Cache is an interface for caching
|
||||
type Cache interface {
|
||||
// Initialise options
|
||||
Init(...Option) error
|
||||
@@ -14,6 +15,15 @@ type Cache interface {
|
||||
String() string
|
||||
}
|
||||
|
||||
type Options struct{}
|
||||
type Options struct {
|
||||
Nodes []string
|
||||
}
|
||||
|
||||
type Option func(o *Options)
|
||||
|
||||
// Nodes sets the nodes for the cache
|
||||
func Nodes(v ...string) Option {
|
||||
return func(o *Options) {
|
||||
o.Nodes = v
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user