Documentation ¶
Overview ¶
Package builder is a generated GoMock package.
Package builder is a generated GoMock package.
Index ¶
- Constants
- Variables
- func GetImage(ctx context.Context, cli DockerEngineClient, ref string) (*types.ImageSummary, error)
- func ImageExists(ctx context.Context, cli DockerEngineClient, ref string) (bool, error)
- func IsCNBBuild(spec godo.AppBuildableComponentSpec) bool
- func IsDockerBuild(spec godo.AppBuildableComponentSpec) bool
- type Buildpack
- type CNBComponentBuilder
- type CNBVersioning
- type ComponentBuilder
- type ComponentBuilderFactory
- type ComponentBuilderResult
- type ContainerExecError
- type DefaultComponentBuilderFactory
- type DockerComponentBuilder
- type DockerEngineClient
- type MockComponentBuilder
- type MockComponentBuilderFactory
- type MockComponentBuilderFactoryMockRecorder
- type MockComponentBuilderMockRecorder
- type MockDockerEngineClient
- func (m *MockDockerEngineClient) ContainerCreate(ctx context.Context, config *container.Config, ...) (container.ContainerCreateCreatedBody, error)
- func (m *MockDockerEngineClient) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)
- func (m *MockDockerEngineClient) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)
- func (m *MockDockerEngineClient) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)
- func (m *MockDockerEngineClient) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error
- func (m *MockDockerEngineClient) ContainerLogs(ctx context.Context, containerName string, options types.ContainerLogsOptions) (io.ReadCloser, error)
- func (m *MockDockerEngineClient) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error
- func (m *MockDockerEngineClient) ContainerStart(ctx context.Context, containerName string, options types.ContainerStartOptions) error
- func (m *MockDockerEngineClient) ContainerWait(ctx context.Context, containerName string, condition container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error)
- func (m *MockDockerEngineClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, ...) error
- func (m *MockDockerEngineClient) EXPECT() *MockDockerEngineClientMockRecorder
- func (m *MockDockerEngineClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
- func (m *MockDockerEngineClient) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)
- func (m *MockDockerEngineClient) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
- type MockDockerEngineClientMockRecorder
- func (mr *MockDockerEngineClientMockRecorder) ContainerCreate(ctx, config, hostConfig, networkingConfig, platform, containerName interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ContainerExecAttach(ctx, execID, config interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ContainerExecCreate(ctx, container, config interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ContainerExecInspect(ctx, execID interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ContainerExecStart(ctx, execID, config interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ContainerLogs(ctx, containerName, options interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ContainerRemove(ctx, container, options interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ContainerStart(ctx, containerName, options interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ContainerWait(ctx, containerName, condition interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) CopyToContainer(ctx, container, path, content, options interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ImageBuild(ctx, context, options interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ImageList(ctx, options interface{}) *gomock.Call
- func (mr *MockDockerEngineClientMockRecorder) ImagePull(ctx, refStr, options interface{}) *gomock.Call
- type NewBuilderOpts
- type Versioning
Constants ¶
const (
// CNBBuilderImage represents the local cnb builder.
CNBBuilderImage = "digitaloceanapps/cnb-local-builder:v0.58.0"
)
const StaticSiteNginxImage = "nginx:alpine"
StaticSiteNginxImage is the nginx image used for static site container images.
Variables ¶
var ErrNotFound = fmt.Errorf("image not found")
Functions ¶
func GetImage ¶
func GetImage(ctx context.Context, cli DockerEngineClient, ref string) (*types.ImageSummary, error)
func ImageExists ¶
func IsCNBBuild ¶
func IsCNBBuild(spec godo.AppBuildableComponentSpec) bool
IsCNBBuild indicates whether the component will be built using the CNB builder.
func IsDockerBuild ¶ added in v1.82.1
func IsDockerBuild(spec godo.AppBuildableComponentSpec) bool
IsDockerBuild indicates whether the component will be built using the Docker builder.
Types ¶
type CNBComponentBuilder ¶
type CNBComponentBuilder struct {
// contains filtered or unexported fields
}
CNBComponentBuilder represents a CNB builder.
func (CNBComponentBuilder) AppImageOutputName ¶
func (b CNBComponentBuilder) AppImageOutputName() string
func (*CNBComponentBuilder) Build ¶
func (b *CNBComponentBuilder) Build(ctx context.Context) (res ComponentBuilderResult, err error)
Build attempts to build the requested component using the CNB Builder and tags the resulting container images.
func (CNBComponentBuilder) StaticSiteImageOutputName ¶
func (b CNBComponentBuilder) StaticSiteImageOutputName() string
type CNBVersioning ¶
type CNBVersioning struct {
Buildpacks []*Buildpack
}
CNBVersioning contains CNB versioning config.
type ComponentBuilder ¶
type ComponentBuilder interface {
Build(context.Context) (ComponentBuilderResult, error)
}
ComponentBuilder is the interface of building one or more components.
type ComponentBuilderFactory ¶
type ComponentBuilderFactory interface {
NewComponentBuilder(DockerEngineClient, string, *godo.AppSpec, NewBuilderOpts) (ComponentBuilder, error)
}
ComponentBuilderFactory is the interface for creating a component builder.
type ComponentBuilderResult ¶
ComponentBuilderResult ...
type ContainerExecError ¶
ContainerExecError contains additional data on a container exec error.
func (ContainerExecError) Error ¶
func (e ContainerExecError) Error() string
Error returns the underlying error.
type DefaultComponentBuilderFactory ¶
type DefaultComponentBuilderFactory struct{}
DefaultComponentBuilderFactory is the standard component builder factory.
func (*DefaultComponentBuilderFactory) NewComponentBuilder ¶
func (f *DefaultComponentBuilderFactory) NewComponentBuilder(cli DockerEngineClient, contextDir string, spec *godo.AppSpec, opts NewBuilderOpts) (ComponentBuilder, error)
NewComponentBuilder returns the correct builder type depending upon the provided app and component.
type DockerComponentBuilder ¶
type DockerComponentBuilder struct {
// contains filtered or unexported fields
}
DockerComponentBuilder builds components using a Dockerfile.
func (DockerComponentBuilder) AppImageOutputName ¶
func (b DockerComponentBuilder) AppImageOutputName() string
func (*DockerComponentBuilder) Build ¶
func (b *DockerComponentBuilder) Build(ctx context.Context) (ComponentBuilderResult, error)
Build executes the component build and tags the resulting container images.
func (DockerComponentBuilder) StaticSiteImageOutputName ¶
func (b DockerComponentBuilder) StaticSiteImageOutputName() string
type DockerEngineClient ¶
type DockerEngineClient interface { ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, platform *specs.Platform, containerName string) (containertypes.ContainerCreateCreatedBody, error) ContainerStart(ctx context.Context, containerName string, options types.ContainerStartOptions) error ContainerLogs(ctx context.Context, containerName string, options types.ContainerLogsOptions) (io.ReadCloser, error) ContainerWait(ctx context.Context, containerName string, condition containertypes.WaitCondition) (<-chan containertypes.ContainerWaitOKBody, <-chan error) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error) }
DockerEngineClient ...
type MockComponentBuilder ¶
type MockComponentBuilder struct {
// contains filtered or unexported fields
}
MockComponentBuilder is a mock of ComponentBuilder interface.
func NewMockComponentBuilder ¶
func NewMockComponentBuilder(ctrl *gomock.Controller) *MockComponentBuilder
NewMockComponentBuilder creates a new mock instance.
func (*MockComponentBuilder) Build ¶
func (m *MockComponentBuilder) Build(arg0 context.Context) (ComponentBuilderResult, error)
Build mocks base method.
func (*MockComponentBuilder) EXPECT ¶
func (m *MockComponentBuilder) EXPECT() *MockComponentBuilderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockComponentBuilderFactory ¶
type MockComponentBuilderFactory struct {
// contains filtered or unexported fields
}
MockComponentBuilderFactory is a mock of ComponentBuilderFactory interface.
func NewMockComponentBuilderFactory ¶
func NewMockComponentBuilderFactory(ctrl *gomock.Controller) *MockComponentBuilderFactory
NewMockComponentBuilderFactory creates a new mock instance.
func (*MockComponentBuilderFactory) EXPECT ¶
func (m *MockComponentBuilderFactory) EXPECT() *MockComponentBuilderFactoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockComponentBuilderFactory) NewComponentBuilder ¶
func (m *MockComponentBuilderFactory) NewComponentBuilder(arg0 DockerEngineClient, arg1 string, arg2 *godo.AppSpec, arg3 NewBuilderOpts) (ComponentBuilder, error)
NewComponentBuilder mocks base method.
type MockComponentBuilderFactoryMockRecorder ¶
type MockComponentBuilderFactoryMockRecorder struct {
// contains filtered or unexported fields
}
MockComponentBuilderFactoryMockRecorder is the mock recorder for MockComponentBuilderFactory.
func (*MockComponentBuilderFactoryMockRecorder) NewComponentBuilder ¶
func (mr *MockComponentBuilderFactoryMockRecorder) NewComponentBuilder(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
NewComponentBuilder indicates an expected call of NewComponentBuilder.
type MockComponentBuilderMockRecorder ¶
type MockComponentBuilderMockRecorder struct {
// contains filtered or unexported fields
}
MockComponentBuilderMockRecorder is the mock recorder for MockComponentBuilder.
func (*MockComponentBuilderMockRecorder) Build ¶
func (mr *MockComponentBuilderMockRecorder) Build(arg0 interface{}) *gomock.Call
Build indicates an expected call of Build.
type MockDockerEngineClient ¶
type MockDockerEngineClient struct {
// contains filtered or unexported fields
}
MockDockerEngineClient is a mock of DockerEngineClient interface.
func NewMockDockerEngineClient ¶
func NewMockDockerEngineClient(ctrl *gomock.Controller) *MockDockerEngineClient
NewMockDockerEngineClient creates a new mock instance.
func (*MockDockerEngineClient) ContainerCreate ¶
func (m *MockDockerEngineClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.ContainerCreateCreatedBody, error)
ContainerCreate mocks base method.
func (*MockDockerEngineClient) ContainerExecAttach ¶
func (m *MockDockerEngineClient) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)
ContainerExecAttach mocks base method.
func (*MockDockerEngineClient) ContainerExecCreate ¶
func (m *MockDockerEngineClient) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)
ContainerExecCreate mocks base method.
func (*MockDockerEngineClient) ContainerExecInspect ¶
func (m *MockDockerEngineClient) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)
ContainerExecInspect mocks base method.
func (*MockDockerEngineClient) ContainerExecStart ¶
func (m *MockDockerEngineClient) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error
ContainerExecStart mocks base method.
func (*MockDockerEngineClient) ContainerLogs ¶
func (m *MockDockerEngineClient) ContainerLogs(ctx context.Context, containerName string, options types.ContainerLogsOptions) (io.ReadCloser, error)
ContainerLogs mocks base method.
func (*MockDockerEngineClient) ContainerRemove ¶
func (m *MockDockerEngineClient) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error
ContainerRemove mocks base method.
func (*MockDockerEngineClient) ContainerStart ¶
func (m *MockDockerEngineClient) ContainerStart(ctx context.Context, containerName string, options types.ContainerStartOptions) error
ContainerStart mocks base method.
func (*MockDockerEngineClient) ContainerWait ¶
func (m *MockDockerEngineClient) ContainerWait(ctx context.Context, containerName string, condition container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error)
ContainerWait mocks base method.
func (*MockDockerEngineClient) CopyToContainer ¶
func (m *MockDockerEngineClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error
CopyToContainer mocks base method.
func (*MockDockerEngineClient) EXPECT ¶
func (m *MockDockerEngineClient) EXPECT() *MockDockerEngineClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDockerEngineClient) ImageBuild ¶
func (m *MockDockerEngineClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
ImageBuild mocks base method.
func (*MockDockerEngineClient) ImageList ¶
func (m *MockDockerEngineClient) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)
ImageList mocks base method.
func (*MockDockerEngineClient) ImagePull ¶
func (m *MockDockerEngineClient) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
ImagePull mocks base method.
type MockDockerEngineClientMockRecorder ¶
type MockDockerEngineClientMockRecorder struct {
// contains filtered or unexported fields
}
MockDockerEngineClientMockRecorder is the mock recorder for MockDockerEngineClient.
func (*MockDockerEngineClientMockRecorder) ContainerCreate ¶
func (mr *MockDockerEngineClientMockRecorder) ContainerCreate(ctx, config, hostConfig, networkingConfig, platform, containerName interface{}) *gomock.Call
ContainerCreate indicates an expected call of ContainerCreate.
func (*MockDockerEngineClientMockRecorder) ContainerExecAttach ¶
func (mr *MockDockerEngineClientMockRecorder) ContainerExecAttach(ctx, execID, config interface{}) *gomock.Call
ContainerExecAttach indicates an expected call of ContainerExecAttach.
func (*MockDockerEngineClientMockRecorder) ContainerExecCreate ¶
func (mr *MockDockerEngineClientMockRecorder) ContainerExecCreate(ctx, container, config interface{}) *gomock.Call
ContainerExecCreate indicates an expected call of ContainerExecCreate.
func (*MockDockerEngineClientMockRecorder) ContainerExecInspect ¶
func (mr *MockDockerEngineClientMockRecorder) ContainerExecInspect(ctx, execID interface{}) *gomock.Call
ContainerExecInspect indicates an expected call of ContainerExecInspect.
func (*MockDockerEngineClientMockRecorder) ContainerExecStart ¶
func (mr *MockDockerEngineClientMockRecorder) ContainerExecStart(ctx, execID, config interface{}) *gomock.Call
ContainerExecStart indicates an expected call of ContainerExecStart.
func (*MockDockerEngineClientMockRecorder) ContainerLogs ¶
func (mr *MockDockerEngineClientMockRecorder) ContainerLogs(ctx, containerName, options interface{}) *gomock.Call
ContainerLogs indicates an expected call of ContainerLogs.
func (*MockDockerEngineClientMockRecorder) ContainerRemove ¶
func (mr *MockDockerEngineClientMockRecorder) ContainerRemove(ctx, container, options interface{}) *gomock.Call
ContainerRemove indicates an expected call of ContainerRemove.
func (*MockDockerEngineClientMockRecorder) ContainerStart ¶
func (mr *MockDockerEngineClientMockRecorder) ContainerStart(ctx, containerName, options interface{}) *gomock.Call
ContainerStart indicates an expected call of ContainerStart.
func (*MockDockerEngineClientMockRecorder) ContainerWait ¶
func (mr *MockDockerEngineClientMockRecorder) ContainerWait(ctx, containerName, condition interface{}) *gomock.Call
ContainerWait indicates an expected call of ContainerWait.
func (*MockDockerEngineClientMockRecorder) CopyToContainer ¶
func (mr *MockDockerEngineClientMockRecorder) CopyToContainer(ctx, container, path, content, options interface{}) *gomock.Call
CopyToContainer indicates an expected call of CopyToContainer.
func (*MockDockerEngineClientMockRecorder) ImageBuild ¶
func (mr *MockDockerEngineClientMockRecorder) ImageBuild(ctx, context, options interface{}) *gomock.Call
ImageBuild indicates an expected call of ImageBuild.
func (*MockDockerEngineClientMockRecorder) ImageList ¶
func (mr *MockDockerEngineClientMockRecorder) ImageList(ctx, options interface{}) *gomock.Call
ImageList indicates an expected call of ImageList.
func (*MockDockerEngineClientMockRecorder) ImagePull ¶
func (mr *MockDockerEngineClientMockRecorder) ImagePull(ctx, refStr, options interface{}) *gomock.Call
ImagePull indicates an expected call of ImagePull.
type NewBuilderOpts ¶
type NewBuilderOpts struct { Component string Registry string EnvOverride map[string]string BuildCommandOverride string CNBBuilderImageOverride string LogWriter io.Writer Versioning Versioning LocalCacheDir string NoCache bool }
NewBuilderOpts ...
type Versioning ¶
type Versioning struct {
CNB *godo.AppBuildConfigCNBVersioning
}
Versioning contains build versioning configuration.