environment

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2015 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The path to the alloc directory that is shared across tasks within a task
	// group.
	AllocDir = "NOMAD_ALLOC_DIR"

	// The path to the tasks local directory where it can store data that is
	// persisted to the alloc is removed.
	TaskLocalDir = "NOMAD_TASK_DIR"

	// The tasks memory limit in MBs.
	MemLimit = "NOMAD_MEMORY_LIMIT"

	// The tasks limit in MHz.
	CpuLimit = "NOMAD_CPU_LIMIT"

	// The IP address for the task.
	TaskIP = "NOMAD_IP"

	// Prefix for passing both dynamic and static port allocations to
	// tasks.
	// E.g. $NOMAD_PORT_1 or $NOMAD_PORT_http
	PortPrefix = "NOMAD_PORT_"

	// Prefix for passing task meta data.
	MetaPrefix = "NOMAD_META_"
)

A set of environment variables that are exported by each driver.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskEnvironment

type TaskEnvironment map[string]string

func NewTaskEnivornment

func NewTaskEnivornment() TaskEnvironment

func ParseFromList

func ParseFromList(envVars []string) (TaskEnvironment, error)

ParseFromList parses a list of strings with NAME=value pairs and returns a TaskEnvironment.

func (TaskEnvironment) ClearAllocDir added in v0.2.0

func (t TaskEnvironment) ClearAllocDir()

func (TaskEnvironment) ClearCpuLimit added in v0.2.0

func (t TaskEnvironment) ClearCpuLimit()

func (TaskEnvironment) ClearEnvvars added in v0.2.0

func (t TaskEnvironment) ClearEnvvars()

func (TaskEnvironment) ClearMemLimit added in v0.2.0

func (t TaskEnvironment) ClearMemLimit()

func (TaskEnvironment) ClearMeta added in v0.2.0

func (t TaskEnvironment) ClearMeta()

func (TaskEnvironment) ClearPorts added in v0.2.0

func (t TaskEnvironment) ClearPorts()

func (TaskEnvironment) ClearTaskIp added in v0.2.0

func (t TaskEnvironment) ClearTaskIp()

func (TaskEnvironment) ClearTaskLocalDir added in v0.2.0

func (t TaskEnvironment) ClearTaskLocalDir()

func (TaskEnvironment) List

func (t TaskEnvironment) List() []string

Returns a list of strings with NAME=value pairs.

func (TaskEnvironment) Map

func (t TaskEnvironment) Map() map[string]string

func (TaskEnvironment) SetAllocDir

func (t TaskEnvironment) SetAllocDir(dir string)

func (TaskEnvironment) SetCpuLimit

func (t TaskEnvironment) SetCpuLimit(limit int)

func (TaskEnvironment) SetEnvvars added in v0.1.1

func (t TaskEnvironment) SetEnvvars(m map[string]string)

func (TaskEnvironment) SetMemLimit

func (t TaskEnvironment) SetMemLimit(limit int)

func (TaskEnvironment) SetMeta

func (t TaskEnvironment) SetMeta(m map[string]string)

Takes a map of meta values to be passed to the task. The keys are capatilized when the environent variable is set.

func (TaskEnvironment) SetPorts

func (t TaskEnvironment) SetPorts(ports map[string]int)

Takes a map of port labels to their port value.

func (TaskEnvironment) SetTaskIp

func (t TaskEnvironment) SetTaskIp(ip string)

func (TaskEnvironment) SetTaskLocalDir added in v0.2.0

func (t TaskEnvironment) SetTaskLocalDir(dir string)

Jump to

Keyboard shortcuts

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