Documentation ¶
Overview ¶
Package container is used for creating new docker containers from config using a builder pattern
Index ¶
- Variables
- func GetLogs(controller *controller.Controller, container *Container) (string, error)
- func Remove(controller *controller.Controller, containerIDs ...string) error
- func Start(controller *controller.Controller, container *Container, stdin string) error
- func Wait(controller *controller.Controller, containerID string, timeLimit time.Duration) (state int64, err error)
- type Builder
- type Container
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorTimeout = errors.New("container killed due to timeout")
)
Functions ¶
func GetLogs ¶ added in v0.4.0
func GetLogs(controller *controller.Controller, container *Container) (string, error)
GetLogs returns logs of a specific container
func Remove ¶ added in v0.4.0
func Remove(controller *controller.Controller, containerIDs ...string) error
Remove deletes a specific container from host
func Start ¶ added in v0.4.0
func Start(controller *controller.Controller, container *Container, stdin 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 has either finished executing or was killed for exceeding time limit
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is a structure used for building new docker container
func NewContainerBuilder ¶
func NewContainerBuilder(controller *controller.Controller) *Builder
NewContainerBuilder returns a Builder object that will be used for building a docker container
type Container ¶
type Container struct { // ID of the container ID string // Maximum allowed time for the container to run TimeLimit time.Duration // A connection to a container that allows you to read from stdout and // write into stdin. Connection types.HijackedResponse }
Container struct holds information about newly created container
Click to show internal directories.
Click to hide internal directories.