generator

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Overview

Package generator contains the code to generate Build from BuildConfig as well as REST support to help expose the generator from an API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewREST

func NewREST(generator *BuildGenerator) (*CloneREST, *InstantiateREST)

Types

type BuildGenerator

type BuildGenerator struct {
	Client GeneratorClient
}

BuildGenerator is a central place responsible for generating new Build objects from BuildConfigs and other Builds.

func (*BuildGenerator) Clone

func (g *BuildGenerator) Clone(ctx kapi.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)

Clone returns clone of a Build

func (*BuildGenerator) Instantiate

func (g *BuildGenerator) Instantiate(ctx kapi.Context, request *buildapi.BuildRequest) (*buildapi.Build, error)

Instantiate returns new Build object based on a BuildRequest object

type Client

type Client struct {
	GetBuildConfigFunc     func(ctx kapi.Context, name string) (*buildapi.BuildConfig, error)
	UpdateBuildConfigFunc  func(ctx kapi.Context, buildConfig *buildapi.BuildConfig) error
	GetBuildFunc           func(ctx kapi.Context, name string) (*buildapi.Build, error)
	CreateBuildFunc        func(ctx kapi.Context, build *buildapi.Build) error
	GetImageRepositoryFunc func(ctx kapi.Context, name string) (*imageapi.ImageRepository, error)
}

func (Client) CreateBuild

func (c Client) CreateBuild(ctx kapi.Context, build *buildapi.Build) error

func (Client) GetBuild

func (c Client) GetBuild(ctx kapi.Context, name string) (*buildapi.Build, error)

func (Client) GetBuildConfig

func (c Client) GetBuildConfig(ctx kapi.Context, name string) (*buildapi.BuildConfig, error)

func (Client) GetImageRepository

func (c Client) GetImageRepository(ctx kapi.Context, name string) (*imageapi.ImageRepository, error)

func (Client) UpdateBuildConfig

func (c Client) UpdateBuildConfig(ctx kapi.Context, buildConfig *buildapi.BuildConfig) error

type CloneREST

type CloneREST struct {
	// contains filtered or unexported fields
}

CloneREST is a RESTStorage implementation for a BuildGenerator which supports only the Get operation (as the generator has no underlying storage object).

func (*CloneREST) Create

func (s *CloneREST) Create(ctx kapi.Context, obj runtime.Object) (runtime.Object, error)

func (*CloneREST) New

func (s *CloneREST) New() runtime.Object

type GeneratorClient

type GeneratorClient interface {
	GetBuildConfig(ctx kapi.Context, name string) (*buildapi.BuildConfig, error)
	UpdateBuildConfig(ctx kapi.Context, buildConfig *buildapi.BuildConfig) error
	GetBuild(ctx kapi.Context, name string) (*buildapi.Build, error)
	CreateBuild(ctx kapi.Context, build *buildapi.Build) error
	GetImageRepository(ctx kapi.Context, name string) (*imageapi.ImageRepository, error)
}

type InstantiateREST

type InstantiateREST struct {
	// contains filtered or unexported fields
}

InstantiateREST is a RESTStorage implementation for a BuildGenerator which supports only the Get operation (as the generator has no underlying storage object).

func (*InstantiateREST) Create

func (s *InstantiateREST) Create(ctx kapi.Context, obj runtime.Object) (runtime.Object, error)

func (*InstantiateREST) New

func (s *InstantiateREST) New() runtime.Object

Jump to

Keyboard shortcuts

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