store

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypePut    = kvpb.Event_PUT
	EventTypeDelete = kvpb.Event_DELETE
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Etcd

type Etcd struct {
	// contains filtered or unexported fields
}

func NewEtcd

func NewEtcd(kv *clientv3.Client) (*Etcd, error)

func (*Etcd) Close

func (s *Etcd) Close() error

func (*Etcd) KV

func (s *Etcd) KV(path string) (map[string]string, error)

func (*Etcd) Set

func (s *Etcd) Set(path string, kv map[string]string) error

func (*Etcd) SetRoot

func (c *Etcd) SetRoot(root string)

func (*Etcd) Watch

func (s *Etcd) Watch(path string) (chan Event, chan error)

type Event

type Event struct {
	Type  EventType
	Key   string
	Value string
}

type EventType

type EventType = kvpb.Event_EventType

type Store

type Store interface {
	KV(path string) (map[string]string, error)
	Set(path string, kv map[string]string) error
	Watch(path string) (chan Event, chan error)
	Close() error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL