kubernetes: github.com/erikstmartin/kubernetes/pkg/registry/generic/etcd Index | Files

package etcd

import "github.com/erikstmartin/kubernetes/pkg/registry/generic/etcd"

Package etcd has a generic implementation of a registry that stores things in etcd.


Package Files

doc.go etcd.go

type Etcd Uses

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 "/"
    KeyRoot string

    // Called for Create/Update/Get/Delete
    KeyFunc func(id string) string

    // 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 Uses

func (e *Etcd) Create(ctx api.Context, id string, obj runtime.Object) error

Create inserts a new item.

func (*Etcd) Delete Uses

func (e *Etcd) Delete(ctx api.Context, id string) error

Delete removes the item from etcd.

func (*Etcd) Get Uses

func (e *Etcd) Get(ctx api.Context, id string) (runtime.Object, error)

Get retrieves the item from etcd.

func (*Etcd) List Uses

func (e *Etcd) List(ctx api.Context, m generic.Matcher) (runtime.Object, error)

List returns a list of all the items matching m.

func (*Etcd) Update Uses

func (e *Etcd) Update(ctx api.Context, id string, obj runtime.Object) error

Update updates the item.

func (*Etcd) Watch Uses

func (e *Etcd) Watch(ctx api.Context, m generic.Matcher, resourceVersion uint64) (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.

Package etcd imports 6 packages (graph). Updated 2018-04-10. Refresh now. Tools for package owners.