Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrImageNotFound = errors.New("image not found")
Functions ¶
This section is empty.
Types ¶
type BuildOption ¶
type BuildOption func(*buildOptions)
BuildOption sets options for build operations.
func WithBuildCleanup ¶ added in v0.5.0
func WithBuildCleanup() BuildOption
WithBuildCleanup sets build to remove old images.
func WithBuildTemplate ¶ added in v0.4.0
func WithBuildTemplate(template string) BuildOption
WithBuildTemplate sets template for container image.
func WithBuildUser ¶ added in v0.5.0
func WithBuildUser(u user.User) BuildOption
WithBuildUser sets the user for the image.
type CmdServiceOption ¶
type CmdServiceOption func(*cmdService)
CmdServiceOption sets options to the service.
func WithCmdServiceConfigDir ¶
func WithCmdServiceConfigDir(path string) CmdServiceOption
WithCmdServiceConfigDir sets the configuration directory for the service.
func WithCmdServiceUser ¶
func WithCmdServiceUser(user string) CmdServiceOption
WithCmdServiceUser sets the user for the service.
func WithCmdServiceVersion ¶
func WithCmdServiceVersion(version string) CmdServiceOption
WithCmdServiceVersion sets the version of cmdproxy to the service.
func WithCmdServiceWorkspaceRoot ¶
func WithCmdServiceWorkspaceRoot(root string) CmdServiceOption
WithCmdServiceWorkspaceRoot sets the workspace root for the service.
type RunOption ¶
type RunOption func(*runOptions)
RunOption sets options for run operations.
func WithRunBuild ¶
func WithRunBuild() RunOption
WithRunBuild sets run opertation to build if image does not exist.
func WithRunDetach ¶
func WithRunDetach() RunOption
WithRunDetach sets the run operation to detach from the container.
func WithRunEnv ¶
WithRunEnv sets environment variables to the container.
func WithRunImage ¶
WithRunImage sets the image for the container.
func WithRunName ¶
WithRunName sets the name for the container.
func WithRunVolumes ¶
WithRunVolumes sets volumes to the container.
func WithRunWorkspace ¶
WithRunWorkspace sets a workspace to the container.
type Service ¶
type Service interface {
Run(ctx context.Context, options ...RunOption) error
Build(ctx context.Context, options ...BuildOption) error
}
Service provided methods to run cmdproxy as a container, and to build the image for it.
func NewCmdService ¶
func NewCmdService(options ...CmdServiceOption) (Service, error)
NewCmdService creates and returns a new container service based on exec.Cmd.