models

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerEngineBuilder

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

DockerEngineBuilder is a struct that is used for constructing an EngineSpec object specifically for Docker engines using the Builder pattern. It embeds an EngineBuilder object for handling the common builder methods.

func NewDockerEngineBuilder

func NewDockerEngineBuilder(image string) *DockerEngineBuilder

NewDockerEngineBuilder function initializes a new DockerEngineBuilder instance. It sets the engine type to model.EngineDocker.String() and image as per the input argument.

func (*DockerEngineBuilder) Build

func (b *DockerEngineBuilder) Build() (*models.SpecConfig, error)

Build method constructs the final SpecConfig object by calling the embedded EngineBuilder's Build method.

func (*DockerEngineBuilder) MustBuild added in v1.5.0

func (b *DockerEngineBuilder) MustBuild() *models.SpecConfig

func (*DockerEngineBuilder) WithEntrypoint

func (b *DockerEngineBuilder) WithEntrypoint(e ...string) *DockerEngineBuilder

WithEntrypoint is a builder method that sets the Docker engine entrypoint. It returns the DockerEngineBuilder for further chaining of builder methods.

func (*DockerEngineBuilder) WithEnvironmentVariables

func (b *DockerEngineBuilder) WithEnvironmentVariables(e ...string) *DockerEngineBuilder

WithEnvironmentVariables is a builder method that sets the Docker engine's environment variables. It returns the DockerEngineBuilder for further chaining of builder methods.

func (*DockerEngineBuilder) WithParameters

func (b *DockerEngineBuilder) WithParameters(e ...string) *DockerEngineBuilder

WithParameters is a builder method that sets the Docker engine's parameters. It returns the DockerEngineBuilder for further chaining of builder methods.

func (*DockerEngineBuilder) WithWorkingDirectory

func (b *DockerEngineBuilder) WithWorkingDirectory(e string) *DockerEngineBuilder

WithWorkingDirectory is a builder method that sets the Docker engine's working directory. It returns the DockerEngineBuilder for further chaining of builder methods.

type EngineSpec

type EngineSpec struct {
	// Image this should be pullable by docker
	Image string `json:"Image,omitempty"`
	// Entrypoint optionally override the default entrypoint
	Entrypoint []string `json:"Entrypoint,omitempty"`
	// Parameters holds additional commandline arguments
	Parameters []string `json:"Parameters,omitempty"`
	// EnvironmentVariables is a slice of env to run the container with
	EnvironmentVariables []string `json:"EnvironmentVariables,omitempty"`
	// WorkingDirectory inside the container
	WorkingDirectory string `json:"WorkingDirectory,omitempty"`
}

EngineSpec contains necessary parameters to execute a docker job.

func DecodeSpec

func DecodeSpec(spec *models.SpecConfig) (EngineSpec, error)

func (EngineSpec) ToMap

func (c EngineSpec) ToMap() map[string]interface{}

func (EngineSpec) Validate

func (c EngineSpec) Validate() error

Jump to

Keyboard shortcuts

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