Documentation ¶
Index ¶
- Constants
- Variables
- func NewEtcdStorage(client etcd.Client, codec runtime.Codec, prefix string, quorum bool, ...) storage.Interface
- type APIObjectVersioner
- func (a APIObjectVersioner) CompareResourceVersion(lhs, rhs runtime.Object) int
- func (a APIObjectVersioner) ObjectResourceVersion(obj runtime.Object) (uint64, error)
- func (a APIObjectVersioner) PrepareObjectForStorage(obj runtime.Object) error
- func (a APIObjectVersioner) UpdateList(obj runtime.Object, resourceVersion uint64, nextKey string) error
- func (a APIObjectVersioner) UpdateObject(obj runtime.Object, resourceVersion uint64) error
- type TransformFunc
- type ValueTransformer
Constants ¶
const ( EtcdCreate = "create" EtcdGet = "get" EtcdSet = "set" EtcdCAS = "compareAndSwap" EtcdDelete = "delete" EtcdCAD = "compareAndDelete" EtcdExpire = "expire" )
Etcd watch event actions
Variables ¶
var Versioner storage.Versioner = APIObjectVersioner{}
APIObjectVersioner implements Versioner
Functions ¶
Types ¶
type APIObjectVersioner ¶
type APIObjectVersioner struct{}
APIObjectVersioner implements versioning and extracting etcd node information for objects that have an embedded ObjectMeta or ListMeta field.
func (APIObjectVersioner) CompareResourceVersion ¶
func (a APIObjectVersioner) CompareResourceVersion(lhs, rhs runtime.Object) int
CompareResourceVersion compares etcd resource versions. Outside this API they are all strings, but etcd resource versions are special, they're actually ints, so we can easily compare them.
func (APIObjectVersioner) ObjectResourceVersion ¶
func (a APIObjectVersioner) ObjectResourceVersion(obj runtime.Object) (uint64, error)
ObjectResourceVersion implements Versioner
func (APIObjectVersioner) PrepareObjectForStorage ¶
func (a APIObjectVersioner) PrepareObjectForStorage(obj runtime.Object) error
PrepareObjectForStorage clears resource version and self link prior to writing to etcd.
func (APIObjectVersioner) UpdateList ¶
func (a APIObjectVersioner) UpdateList(obj runtime.Object, resourceVersion uint64, nextKey string) error
UpdateList implements Versioner
func (APIObjectVersioner) UpdateObject ¶
func (a APIObjectVersioner) UpdateObject(obj runtime.Object, resourceVersion uint64) error
UpdateObject implements Versioner
type TransformFunc ¶
TransformFunc attempts to convert an object to another object for use with a watcher.
type ValueTransformer ¶
type ValueTransformer interface { // TransformStringFromStorage may transform the provided string from its underlying storage representation or return an error. // Stale is true if the object on disk is stale and a write to etcd should be issued, even if the contents of the object // have not changed. TransformStringFromStorage(string) (value string, stale bool, err error) // TransformStringToStorage may transform the provided string into the appropriate form in storage or return an error. TransformStringToStorage(string) (value string, err error) }
ValueTransformer allows a string value to be transformed before being read from or written to the underlying store. The methods must be able to undo the transformation caused by the other.
var IdentityTransformer ValueTransformer = identityTransformer{}
IdentityTransformer performs no transformation on the provided values.
Directories ¶
Path | Synopsis |
---|---|
Package util holds generic etcd-related utility functions that any user of ectd might want to use, without pulling in kubernetes-specific code.
|
Package util holds generic etcd-related utility functions that any user of ectd might want to use, without pulling in kubernetes-specific code. |