runcontext

package
v0.0.0-...-7ac0fad Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunContext

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

RunContext define a docker run collection of mount and env which can be re-used for a second container in DooD mode

func NewRunContext

func NewRunContext(sharedName string, volumeSize int) (ret *RunContext)

NewRunContext create a new docker Run Context to shared

func (*RunContext) AddEnv

func (r *RunContext) AddEnv(key, value string) *RunContext

AddEnv add a env option to the current Context

func (*RunContext) AddFromEnv

func (r *RunContext) AddFromEnv(key string) *RunContext

AddFromEnv create a new docker run env (-e) from existing environment variable.

func (*RunContext) AddOptions

func (r *RunContext) AddOptions(options ...string) *RunContext

AddOptions add a env option to the current Context

func (*RunContext) AddShared

func (r *RunContext) AddShared()

AddShared return the shared variables with context options if shared == true

func (*RunContext) AddVolume

func (r *RunContext) AddVolume(volume string) *RunContext

AddVolume add a volume option to the current Context

func (*RunContext) BuildOptions

func (r *RunContext) BuildOptions() (ret []string)

BuildOptions creates an array of options for cmd.

func (*RunContext) DefineContainerFuncs

func (r *RunContext) DefineContainerFuncs(addVolume func(string), addEnv func(string, string), addHiddenEnv func(string, string), addOptions func(...string))

DefineContainerFuncs define 3 container functions to update container options automatically.

func (*RunContext) GetFrom

func (r *RunContext) GetFrom() (shared bool)

GetFrom buiild the docker Run Context from the shared name found from GetEnv

Jump to

Keyboard shortcuts

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