Documentation ¶
Overview ¶
Package etcdhelper implements marshaling whole etcd prefixes from and to go values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
Marshals a go value to a slice of etcd PUT operations with a given prefix.
Currently only go structs are supported.
Use the etcd tag to map a given struct field to a different name in etcd or use "-" to don't map the key. E.g. `etcd:"foo"` maps a struct field to the etcd key named "foo".
func UnmarshalGet ¶
Makes an etcd prefix query and unmarshals the result into the given `dest` value. It returns the number of query results that were mapped to the `dest` value. The unmarshal currently can only handle maps with string keys and structs. Structs are mapped with their element names by default. To override this use the `etcd` tag. A `-` as key name indicates that the given struct element is not mapped to etcd. E.g. to map the etcd field named foo use `etcd:"foo"` for the corresponding struct field
Types ¶
This section is empty.