environment

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 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 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)

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

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)

Jump to

Keyboard shortcuts

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