micro/store/store.go

33 lines
521 B
Go
Raw Normal View History

2015-01-13 23:31:27 +00:00
package store
type Store interface {
Get(string) (Item, error)
Del(string) error
Put(Item) error
NewItem(string, []byte) Item
}
type options struct{}
type Options func(*options)
2015-01-13 23:31:27 +00:00
var (
DefaultStore = NewConsulStore([]string{})
2015-01-13 23:31:27 +00:00
)
func Get(key string) (Item, error) {
return DefaultStore.Get(key)
}
func Del(key string) error {
return DefaultStore.Del(key)
}
func Put(item Item) error {
return DefaultStore.Put(item)
}
func NewItem(key string, value []byte) Item {
return DefaultStore.NewItem(key, value)
}