container

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package container is used for creating docker containers using a builder pattern.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureImage added in v0.4.0

func EnsureImage(controller *controller.Controller, imageName string) error

EnsureImage pulls images from docker hub to make sure in exists

func GetLogs added in v0.4.0

func GetLogs(controller *controller.Controller, containerID string) (string, error)

GetLogs returns logs of a specific container

func Remove added in v0.4.0

func Remove(controller *controller.Controller, containerID string) error

Remove deletes a container

func Start added in v0.4.0

func Start(controller *controller.Controller, containerID string) error

Start starts a container

func Wait added in v0.4.0

func Wait(controller *controller.Controller, containerID string, timeLimit time.Duration) (state int64, err error)

Wait waits until the container is stopped

Types

type Builder

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

func NewContainerBuilder

func NewContainerBuilder(controller *controller.Controller) *Builder

func (*Builder) Build

func (b *Builder) Build() (*Container, error)

func (*Builder) SetConfig

func (b *Builder) SetConfig(config *config.Config) *Builder

type Container

type Container struct {
	ID        string
	TimeLimit time.Duration
}

Jump to

Keyboard shortcuts

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