Documentation ¶
Index ¶
- Constants
- type TaskEnvironment
- func (t TaskEnvironment) List() []string
- func (t TaskEnvironment) Map() map[string]string
- func (t TaskEnvironment) SetAllocDir(dir string)
- func (t TaskEnvironment) SetCpuLimit(limit int)
- func (t TaskEnvironment) SetMemLimit(limit int)
- func (t TaskEnvironment) SetMeta(m map[string]string)
- func (t TaskEnvironment) SetPorts(ports map[string]int)
- func (t TaskEnvironment) SetTaskIp(ip string)
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 ¶
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) 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)
Click to show internal directories.
Click to hide internal directories.