Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Decorator = func(obj runtime.Object) error { switch t := obj.(type) { case *api.Build: setBuildDuration(t) case *api.BuildList: for i := range t.Items { setBuildDuration(&t.Items[i]) } default: return errors.NewBadRequest(fmt.Sprintf("not a Build nor BuildList: %v", obj)) } return nil }
Decorator is used to compute duration of a build since its not stored in etcd yet
View Source
var DetailsStrategy = detailsStrategy{Strategy}
DetailsStrategy is the strategy used to manage updates to a Build revision
View Source
var Strategy = strategy{kapi.Scheme, kapi.SimpleNameGenerator}
Strategy is the default logic that applies when creating and updating Build objects.
Functions ¶
Types ¶
type Registry ¶
type Registry interface {
// ListBuilds obtains list of builds that match a selector.
ListBuilds(ctx kapi.Context, options *kapi.ListOptions) (*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, options *kapi.ListOptions) (watch.Interface, error)
}
Registry is an interface for things that know how to store Builds.
func NewRegistry ¶
func NewRegistry(s rest.StandardStorage) Registry
NewRegistry returns a new Registry interface for the given Storage. Any mismatched types will panic.
Source Files
¶
- registry.go
- strategy.go
Click to show internal directories.
Click to hide internal directories.