add Live/Ready/Health methods
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -149,6 +149,18 @@ func (m *memoryStore) Name() string {
|
||||
return m.opts.Name
|
||||
}
|
||||
|
||||
func (m *memoryStore) Live() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (m *memoryStore) Ready() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (m *memoryStore) Health() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (m *memoryStore) Exists(ctx context.Context, key string, opts ...store.ExistsOption) error {
|
||||
if m.opts.LazyConnect {
|
||||
if err := m.connect(ctx); err != nil {
|
||||
@@ -279,3 +291,16 @@ func (m *memoryStore) connect(ctx context.Context) error {
|
||||
m.isConnected.CompareAndSwap(0, 1)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *memoryStore) Watch(ctx context.Context, opts ...store.WatchOption) (store.Watcher, error) {
|
||||
return &watcher{}, nil
|
||||
}
|
||||
|
||||
type watcher struct{}
|
||||
|
||||
func (w *watcher) Next() (store.Event, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (w *watcher) Stop() {
|
||||
}
|
||||
|
Reference in New Issue
Block a user