template

package
v0.0.0-...-5168a6d Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Config is a pointer need to be set to the main configuration
	Config *config.ConfigurationInfo
)

Functions

This section is empty.

Types

type Template

type Template struct {
	Name          string            `json:"name"`
	Ports         []int64           `json:"ports"`
	Constraints   map[string]string `json:"constraints"`
	UnitContent   string            `json:"unitContent"`
	MaxPerMachine int64             `json:"maxPerMachine"`
	// contains filtered or unexported fields
}

Template contains all info of a template

func GetAll

func GetAll() ([]Template, error)

GetAll returns all templates in our zone

func New

func New() Template

New returns a new blank Template

func NewFromEtcd

func NewFromEtcd(name string) Template

NewFromEtcd creates a new Template with info from etcd

func (*Template) Delete

func (t *Template) Delete()

Delete removes the template from etcd

func (*Template) NewUnit

func (t *Template) NewUnit(name string, vars map[string]string) unit.Unit

NewUnit gives back a new Unit from the template

func (*Template) SaveOnEtcd

func (t *Template) SaveOnEtcd()

SaveOnEtcd saves the unit to etcd

Jump to

Keyboard shortcuts

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