package etcd
import "k8s.io/kubernetes/pkg/registry/generic/etcd"
Package etcd has a generic implementation of a registry that stores things in etcd.
Index ¶
- func NamespaceKeyFunc(ctx api.Context, prefix string, id string) (string, error)
- func NamespaceKeyRootFunc(ctx api.Context, prefix string) string
- type Etcd
- func (e *Etcd) Create(ctx api.Context, id string, obj runtime.Object) error
- func (e *Etcd) Delete(ctx api.Context, id string) error
- func (e *Etcd) Get(ctx api.Context, id string) (runtime.Object, error)
- func (e *Etcd) List(ctx api.Context, m generic.Matcher) (runtime.Object, error)
- func (e *Etcd) Update(ctx api.Context, id string, obj runtime.Object) error
- func (e *Etcd) Watch(ctx api.Context, m generic.Matcher, resourceVersion string) (watch.Interface, error)
Functions ¶
func NamespaceKeyFunc ¶
NamespaceKeyFunc is the default function for constructing etcd paths to a resource relative to prefix enforcing namespace rules. If no namespace is on context, it errors.
func NamespaceKeyRootFunc ¶
NamespaceKeyRootFunc is the default function for constructing etcd paths to resource directories enforcing namespace rules.
Types ¶
type Etcd ¶
type Etcd struct { // Called to make a new object, should return e.g., &api.Pod{} NewFunc func() runtime.Object // Called to make a new listing object, should return e.g., &api.PodList{} NewListFunc func() runtime.Object // Used for error reporting EndpointName string // Used for listing/watching; should not include trailing "/" KeyRootFunc func(ctx api.Context) string // Called for Create/Update/Get/Delete KeyFunc func(ctx api.Context, id string) (string, error) // Used for all etcd access functions Helper tools.EtcdHelper }
Etcd implements generic.Registry, backing it with etcd storage. It's intended to be embeddable, so that you can implement any non-generic functions if needed. You must supply a value for every field below before use; these are left public as it's meant to be overridable if need be.
func (*Etcd) Create ¶
Create inserts a new item.
func (*Etcd) Delete ¶
Delete removes the item from etcd.
func (*Etcd) Get ¶
Get retrieves the item from etcd.
func (*Etcd) List ¶
List returns a list of all the items matching m.
func (*Etcd) Update ¶
Update updates the item.
func (*Etcd) Watch ¶
func (e *Etcd) Watch(ctx api.Context, m generic.Matcher, resourceVersion string) (watch.Interface, error)
Watch starts a watch for the items that m matches. TODO: Detect if m references a single object instead of a list.
Source Files ¶
doc.go etcd.go
- Version
- v0.8.2
- Published
- Jan 20, 2015
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 27 minutes ago –
Tools for package owners.