options

package
v0.0.0-...-5337229 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildImageOptions

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

BuildImageOptions is used to pass optional arguments when building an Image.

func BuildImage

func BuildImage() *BuildImageOptions

BuildImage returns a new instance of BuildImageOptions.

func WithDockerfile

func WithDockerfile(dockerfile string) *BuildImageOptions

WithDockerfile returns a new instance of BuildImageOptions with the specified Dockerfile.

func (*BuildImageOptions) AsLinuxAmd64

func (opt *BuildImageOptions) AsLinuxAmd64() *BuildImageOptions

AsLinuxAmd64 is used to specify the build architecture as linux/amd64.

func (*BuildImageOptions) Dockerfile

func (opt *BuildImageOptions) Dockerfile() string

Dockerfile is used to get the configured Dockerfile path. If no Dockerfile has been configured, "Dockerfile" will be returned as default.

func (*BuildImageOptions) Platform

func (opt *BuildImageOptions) Platform() (string, bool)

Platform is used to get the configured platform argument. If the platform has been configured, the value with true is returned, otherwise an empty string with false.

func (*BuildImageOptions) WithDockerfile

func (opt *BuildImageOptions) WithDockerfile(dockerfile string) *BuildImageOptions

WithDockerfile is used to specify the path to the Dockerfile.

type StartContainerOptions

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

StartContainerOptions is used to pass optional arguments when starting a container.

func Expose

func Expose(port uint16) *StartContainerOptions

Expose is used to expose a TCP port on the container. The specified port will be exposed on the container and bound to the same port on the host.

func StartContainer

func StartContainer() *StartContainerOptions

StartContainer returns a new instance of StartContainerOptions.

func WithCapAdd

func WithCapAdd(c ...string) *StartContainerOptions

WithCapAdd is used to configure extra UNIX capabilities for the container.

func WithEnvironmentVariable

func WithEnvironmentVariable(name, value string) *StartContainerOptions

WithEnvironmentVariable is used to configure a single environment variable.

func WithEnvironmentVariables

func WithEnvironmentVariables(values map[string]string) *StartContainerOptions

WithEnvironmentVariables is used to configure a collection of environment variables.

func WithName

func WithName(name string) *StartContainerOptions

WithName is used to configure the name of the container to start.

func WithPortBinding

func WithPortBinding(host, container uint16, protocol string) *StartContainerOptions

WithPortBinding is used to configure a port binding to the container.

func (*StartContainerOptions) AsLinuxAmd64

func (opt *StartContainerOptions) AsLinuxAmd64() *StartContainerOptions

AsLinuxAmd64 is used to configure the containers platform as linux/amd64.

func (*StartContainerOptions) CapAdd

func (opt *StartContainerOptions) CapAdd() []string

CapAdd returns the additionally configured UNIX capabilities.

func (*StartContainerOptions) EnvironmentVariables

func (opt *StartContainerOptions) EnvironmentVariables() []string

EnvironmentVariables is used to retrieve the environment variables configuration for starting a containter. The variables are in the formar of "foo=bar".

func (*StartContainerOptions) Expose

Expose is used to expose a TCP port on the container. The specified port will be exposed on the container and bound to the same port on the host.

func (*StartContainerOptions) Name

func (opt *StartContainerOptions) Name() (string, bool)

Name is used to retrieve the configured name for the container. If no name is configured, an empty string followed by a false value is returned.

func (*StartContainerOptions) Platform

func (opt *StartContainerOptions) Platform() (string, bool)

Platform is used to retrieve the platform configuration for the container. If no platform is specifed, an empty string followed by a false value is returned.

func (*StartContainerOptions) Ports

func (opt *StartContainerOptions) Ports() (nat.PortSet, map[nat.Port][]nat.PortBinding, error)

Ports is used to retrieve the Docker port configurations for starting a container. An error value is returned if one of the ports configurations is invalid.

func (*StartContainerOptions) WithCapAdd

func (opt *StartContainerOptions) WithCapAdd(c ...string) *StartContainerOptions

WithCapAdd is used to configure extra UNIX capabilities for the container.

func (*StartContainerOptions) WithEnvironmentVariable

func (opt *StartContainerOptions) WithEnvironmentVariable(name, value string) *StartContainerOptions

WithEnvironmentVariable is used to configure a single environment variable.

func (*StartContainerOptions) WithEnvironmentVariables

func (opt *StartContainerOptions) WithEnvironmentVariables(values map[string]string) *StartContainerOptions

WithEnvironmentVariables is used to configure a collection of environment variables.

func (*StartContainerOptions) WithName

func (opt *StartContainerOptions) WithName(name string) *StartContainerOptions

WithName is used to configure the name of the container to start.

func (*StartContainerOptions) WithPortBinding

func (opt *StartContainerOptions) WithPortBinding(host, container uint16, protocol string) *StartContainerOptions

WithPortBinding is used to configure a port binding to the container.

Jump to

Keyboard shortcuts

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