Documentation ¶
Index ¶
- Variables
- func FnAttach(client *docker.Client, containerID string, stdin io.Reader, stdout io.Writer, ...) (w docker.CloseWaiter, err error)
- func FnClient(endPoint, certsDir string) (client *docker.Client, err error)
- func FnContainer(client *docker.Client, opts ContainerOptions) (container *docker.Container, err error)
- func FnFindContainer(client *docker.Client, imageName string) (container docker.APIContainers, err error)
- func FnFindContainerByID(client *docker.Client, ID string) (container docker.APIContainers, err error)
- func FnFindImage(client *docker.Client, imageName string) (image docker.APIImages, err error)
- func FnImageBuild(client *docker.Client, opts *BuildOptions) (Name string, Stdout *bytes.Buffer, err error)
- func FnKillContainer(client *docker.Client, containerID string) (err error)
- func FnListContainers(client *docker.Client) (containers []docker.APIContainers, err error)
- func FnLogs(client *docker.Client, containerID string, stdout io.Writer, stderr io.Writer) error
- func FnPull(client *docker.Client, opts *BuildOptions) (err error)
- func FnRemove(client *docker.Client, containerID string) (err error)
- func FnRun(client *docker.Client, containerID, input string) (Stdout *bytes.Buffer, Stderr *bytes.Buffer, err error)
- func FnStart(client *docker.Client, containerID string) error
- func FnWaitContainer(client *docker.Client, containerID string) chan error
- type BuildOptions
- type ContainerOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrImageNotFound is raised when image is not found ErrImageNotFound = errors.New("provision: image not found") // ErrContainerNotFound is raised when image is not found ErrContainerNotFound = errors.New("provision: container not found") // ErrContainerExecutionFailed is raised if container exited with status different of zero ErrContainerExecutionFailed = errors.New("provision: container exited with failure") // Input receives a string that will be written to the stdin of the container in function FnRun Input string )
Functions ¶
func FnAttach ¶
func FnAttach(client *docker.Client, containerID string, stdin io.Reader, stdout io.Writer, stderr io.Writer) (w docker.CloseWaiter, err error)
FnAttach attach into a running container
func FnContainer ¶
func FnContainer(client *docker.Client, opts ContainerOptions) (container *docker.Container, err error)
FnContainer create container
func FnFindContainer ¶
func FnFindContainer(client *docker.Client, imageName string) (container docker.APIContainers, err error)
FnFindContainer return container by image name
func FnFindContainerByID ¶
func FnFindContainerByID(client *docker.Client, ID string) (container docker.APIContainers, err error)
FnFindContainerByID return container by ID
func FnFindImage ¶
FnFindImage returns image data by name
func FnImageBuild ¶
func FnImageBuild(client *docker.Client, opts *BuildOptions) (Name string, Stdout *bytes.Buffer, err error)
FnImageBuild builds an image
func FnKillContainer ¶
FnKillContainer kill the container
func FnListContainers ¶
func FnListContainers(client *docker.Client) (containers []docker.APIContainers, err error)
FnListContainers lists all the containers created by the gofn. It returns the APIContainers from the API, but have to be formatted for pretty printing
func FnPull ¶
func FnPull(client *docker.Client, opts *BuildOptions) (err error)
FnPull pull image from registry
func FnRun ¶
func FnRun(client *docker.Client, containerID, input string) (Stdout *bytes.Buffer, Stderr *bytes.Buffer, err error)
FnRun runs the container
Types ¶
type BuildOptions ¶
type BuildOptions struct { ContextDir string Dockerfile string DoNotUsePrefixImageName bool ImageName string RemoteURI string StdIN string Iaas iaas.Iaas Auth docker.AuthConfiguration ForcePull bool }
BuildOptions are options used in the image build
func (BuildOptions) GetImageName ¶
func (opts BuildOptions) GetImageName() string
GetImageName sets prefix gofn when needed
Click to show internal directories.
Click to hide internal directories.