templates

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Controllers

func Controllers(env string) ([]string, error)

Controllers returns a list of controllers for the given environment

func InitGithub

func InitGithub(config *GithubConfig)

InitGithub initializes the github templates service with the given config

func Pods

func Pods(env string) ([]string, error)

Pods returns a list of pods for the given environment

func Variables

func Variables(env string) (map[string]string, error)

Variables returns a list of variabless for the given environment

Types

type GithubConfig

type GithubConfig struct {
	Token            string
	Owner            string
	Repo             string
	EnvContentsPaths map[string]string
}

GithubConfig is the configuration for the github client

type Service

type Service interface {
	Controllers(env string) ([]string, error)
	Controller(env, name string) (Template, error)
	Pods(env string) ([]string, error)
	Pod(env, name string) (Template, error)
	Variables(env string) (map[string]string, error)
}

Service is a template service that returns controller and pod templates for given environments

type Template

type Template string

Template is a yaml string template of a controller of a pod

func Controller

func Controller(env, name string) (Template, error)

Controller returns a list of controllers for the given environment

func Pod

func Pod(env, name string) (Template, error)

Pod returns a list of pods for the given environment

func (Template) Parse

func (t Template) Parse(into interface{}) error

Parse parses template into the given interface

func (Template) Populate

func (t Template) Populate(variables map[string]string) (Template, bool)

Populate populates the template with variables and returns a new Template instance

Jump to

Keyboard shortcuts

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