etcd

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package etcd provides etcd backend implementation for storing PodRegistry, ControllerRegistry and ServiceRegistry api objects.

Index

Constants

View Source
const (
	// ControllerPath is the path to controller resources in etcd
	ControllerPath string = "/registry/controllers"
	// ServicePath is the path to service resources in etcd
	ServicePath string = "/registry/services/specs"
	// ServiceEndpointPath is the path to service endpoints resources in etcd
	ServiceEndpointPath string = "/registry/services/endpoints"
	// NodePath is the path to node resources in etcd
	NodePath string = "/registry/minions"
)

Variables

This section is empty.

Functions

func MakeEtcdItemKey

func MakeEtcdItemKey(ctx api.Context, prefix string, id string) (string, error)

MakeEtcdItemKey constructs etcd paths to a resource relative to prefix enforcing namespace rules. If no namespace is on context, it errors.

func MakeEtcdListKey

func MakeEtcdListKey(ctx api.Context, prefix string) string

MakeEtcdListKey constructs etcd paths to resource directories enforcing namespace rules

Types

type Registry

type Registry struct {
	tools.EtcdHelper
	// contains filtered or unexported fields
}

Registry implements BindingRegistry, ControllerRegistry, EndpointRegistry, MinionRegistry, PodRegistry and ServiceRegistry, backed by etcd.

func NewRegistry

func NewRegistry(helper tools.EtcdHelper, pods pod.Registry) *Registry

NewRegistry creates an etcd registry.

func (*Registry) CreateController

func (r *Registry) CreateController(ctx api.Context, controller *api.ReplicationController) error

CreateController creates a new ReplicationController.

func (*Registry) CreateMinion

func (r *Registry) CreateMinion(ctx api.Context, minion *api.Node) error

func (*Registry) CreateService

func (r *Registry) CreateService(ctx api.Context, svc *api.Service) error

CreateService creates a new Service.

func (*Registry) DeleteController

func (r *Registry) DeleteController(ctx api.Context, controllerID string) error

DeleteController deletes a ReplicationController specified by its ID.

func (*Registry) DeleteMinion

func (r *Registry) DeleteMinion(ctx api.Context, minionID string) error

func (*Registry) DeleteService

func (r *Registry) DeleteService(ctx api.Context, name string) error

DeleteService deletes a Service specified by its name.

func (*Registry) GetController

func (r *Registry) GetController(ctx api.Context, controllerID string) (*api.ReplicationController, error)

GetController gets a specific ReplicationController specified by its ID.

func (*Registry) GetEndpoints

func (r *Registry) GetEndpoints(ctx api.Context, name string) (*api.Endpoints, error)

GetEndpoints obtains the endpoints for the service identified by 'name'.

func (*Registry) GetMinion

func (r *Registry) GetMinion(ctx api.Context, minionID string) (*api.Node, error)

func (*Registry) GetService

func (r *Registry) GetService(ctx api.Context, name string) (*api.Service, error)

GetService obtains a Service specified by its name.

func (*Registry) ListControllers

func (r *Registry) ListControllers(ctx api.Context) (*api.ReplicationControllerList, error)

ListControllers obtains a list of ReplicationControllers.

func (*Registry) ListEndpoints

func (r *Registry) ListEndpoints(ctx api.Context) (*api.EndpointsList, error)

ListEndpoints obtains a list of Services.

func (*Registry) ListMinions

func (r *Registry) ListMinions(ctx api.Context) (*api.NodeList, error)

func (*Registry) ListServices

func (r *Registry) ListServices(ctx api.Context) (*api.ServiceList, error)

ListServices obtains a list of Services.

func (*Registry) UpdateController

func (r *Registry) UpdateController(ctx api.Context, controller *api.ReplicationController) error

UpdateController replaces an existing ReplicationController.

func (*Registry) UpdateEndpoints

func (r *Registry) UpdateEndpoints(ctx api.Context, endpoints *api.Endpoints) error

UpdateEndpoints update Endpoints of a Service.

func (*Registry) UpdateMinion added in v0.2.1

func (r *Registry) UpdateMinion(ctx api.Context, minion *api.Node) error

func (*Registry) UpdateService

func (r *Registry) UpdateService(ctx api.Context, svc *api.Service) error

UpdateService replaces an existing Service.

func (*Registry) WatchControllers

func (r *Registry) WatchControllers(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error)

WatchControllers begins watching for new, changed, or deleted controllers.

func (*Registry) WatchEndpoints

func (r *Registry) WatchEndpoints(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error)

WatchEndpoints begins watching for new, changed, or deleted endpoint configurations.

func (*Registry) WatchMinions added in v0.2.1

func (r *Registry) WatchMinions(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error)

func (*Registry) WatchServices

func (r *Registry) WatchServices(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error)

WatchServices begins watching for new, changed, or deleted service configurations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL