etcd, resources, world: Add World API for shared keys

It's up to the end user to decide who is writing and/or overwriting
them.

It could also be useful to reimplement (refactor) some of the existing
World API's to be implemented in terms of these primitives.
This commit is contained in:
James Shubin
2017-04-17 07:03:29 -04:00
parent 3a0d73f740
commit 0af9af44e5
5 changed files with 189 additions and 53 deletions

View File

@@ -81,9 +81,15 @@ type World interface { // TODO: is there a better name for this interface?
ResCollect(hostnameFilter, kindFilter []string) ([]Res, error)
StrWatch(namespace string) chan error
StrGet(namespace string) (map[string]string, error)
StrIsNotExist(error) bool
StrGet(namespace string) (string, error)
StrSet(namespace, value string) error
StrDel(namespace string) error
StrMapWatch(namespace string) chan error
StrMapGet(namespace string) (map[string]string, error)
StrMapSet(namespace, value string) error
StrMapDel(namespace string) error
}
// Data is the set of input values passed into the pgraph for the resources.