template

package
v0.0.0-...-2f05a08 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandContainerSpec

func ExpandContainerSpec(t *api.Task) (*api.ContainerSpec, error)

ExpandContainerSpec expands templated fields in the runtime using the task state. Templating is all evaluated on the agent-side, before execution.

Note that these are projected only on runtime values, since active task values are typically manipulated in the manager.

Types

type Context

type Context struct {
	Service struct {
		ID     string
		Name   string
		Labels map[string]string
	}

	Node struct {
		ID string
	}

	Task struct {
		ID   string
		Name string
		Slot string
	}
}

Context defines the strict set of values that can be injected into a template expression in SwarmKit data structure.

func NewContextFromTask

func NewContextFromTask(t *api.Task) (ctx Context)

NewContextFromTask returns a new template context from the data available in task. The provided context can then be used to populate runtime values in a ContainerSpec.

func (*Context) Expand

func (ctx *Context) Expand(s string) (string, error)

Expand treats the string s as a template and populates it with values from the context.

Jump to

Keyboard shortcuts

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