build

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Decorator = func(obj runtime.Object) error {
	build, ok := obj.(*api.Build)
	if !ok {
		return errors.NewBadRequest(fmt.Sprintf("not a build: %v", build))
	}
	if build.StartTimestamp == nil {
		build.Duration = time.Duration(0)
	} else {
		completionTimestamp := build.CompletionTimestamp
		if completionTimestamp == nil {
			dummy := util.Now()
			completionTimestamp = &dummy
		}
		build.Duration = completionTimestamp.Rfc3339Copy().Time.Sub(build.StartTimestamp.Rfc3339Copy().Time)
	}
	return nil
}

Decorator is used to compute duration of a build since its not stored in etcd yet

View Source
var Strategy = strategy{kapi.Scheme, kapi.SimpleNameGenerator}

Strategy is the default logic that applies when creating and updating Build objects.

Functions

func Matcher added in v0.5.2

func Matcher(label labels.Selector, field fields.Selector) generic.Matcher

Matcher returns a generic matcher for a given label and field selector.

func SelectableFields added in v0.5.2

func SelectableFields(build *api.Build) fields.Set

SelectableFields returns a label set that represents the object

Types

type Registry

type Registry interface {
	// ListBuilds obtains list of builds that match a selector.
	ListBuilds(ctx kapi.Context, labels labels.Selector, fields fields.Selector) (*api.BuildList, error)
	// GetBuild retrieves a specific build.
	GetBuild(ctx kapi.Context, id string) (*api.Build, error)
	// CreateBuild creates a new build.
	CreateBuild(ctx kapi.Context, build *api.Build) error
	// UpdateBuild updates a build.
	UpdateBuild(ctx kapi.Context, build *api.Build) error
	// DeleteBuild deletes a build.
	DeleteBuild(ctx kapi.Context, id string) error
	// WatchBuilds watches builds.
	WatchBuilds(ctx kapi.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
}

Registry is an interface for things that know how to store Builds.

func NewRegistry added in v0.5.2

func NewRegistry(s rest.StandardStorage) Registry

NewRegistry returns a new Registry interface for the given Storage. Any mismatched types will panic.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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