container

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package container is used for creating new docker containers from config using a builder pattern

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 specific container from host

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 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

func (*Builder) Build

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

Build builds a new docker container

func (*Builder) SetConfig

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

SetConfig sets config that will be later used for building a docker container

type Container

type Container struct {
	ID        string        // ID of the container
	TimeLimit time.Duration // Maximum allowed time for the container to run
}

Container struct holds information about newly created container

Jump to

Keyboard shortcuts

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