v0.3.1 Latest Latest

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

Go to latest
Published: Feb 15, 2015 License: Apache-2.0 Imports: 4 Imported by: 0



Package binding contains the middle layer logic for bindings. Bindings are objects containing instructions for how a pod ought to be bound to a host. This allows a registry object which supports this action (ApplyBinding) to be served through an apiserver.



This section is empty.


This section is empty.


This section is empty.


type MockRegistry

type MockRegistry struct {
	OnApplyBinding func(binding *api.Binding) error

MockRegistry can be used for testing.

func (MockRegistry) ApplyBinding

func (mr MockRegistry) ApplyBinding(ctx api.Context, binding *api.Binding) error

type REST

type REST struct {
	// contains filtered or unexported fields

REST implements the RESTStorage interface for bindings. When bindings are written, it changes the location of the affected pods. This information is eventually reflected in the pod's CurrentState.Host field.

func NewREST

func NewREST(bindingRegistry Registry) *REST

NewREST creates a new REST backed by the given bindingRegistry.

func (*REST) Create

func (b *REST) Create(ctx api.Context, obj runtime.Object) (<-chan apiserver.RESTResult, error)

Create attempts to make the assignment indicated by the binding it recieves.

func (*REST) New

func (*REST) New() runtime.Object

New returns a new binding object fit for having data unmarshalled into it.

type Registry

type Registry interface {
	// ApplyBinding should apply the binding. That is, it should actually
	// assign or place pod binding.PodID on machine binding.Host.
	ApplyBinding(ctx api.Context, binding *api.Binding) error

Registry contains the functions needed to support a BindingStorage.

Jump to

Keyboard shortcuts

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