Add memcache implementation of cache (#1848)

This commit is contained in:
Asim Aslam
2020-07-16 14:13:38 +01:00
committed by GitHub
parent 3627e47f04
commit e63b9015ae
4 changed files with 94 additions and 1 deletions

12
cache/cache.go vendored
View File

@@ -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
}
}