boshgotemplate

package module
v0.0.0-...-32ddfa4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 9 Imported by: 1

README

Build Status godoc go report card Coverage Status

bosh-template-go

go package for rendering bosh erb templates

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RubyBinary is the name of the ruby binary. Can be an absolute path.
	RubyBinary = "ruby"
	// RubyGemBinary is the name of the ruby gem binary. Can be an absolute path.
	RubyGemBinary = "gem"
)

Functions

func CheckBOSHTemplateGemAvailable

func CheckBOSHTemplateGemAvailable() error

CheckBOSHTemplateGemAvailable can be used by callers to verify that the bosh template gem is correctly installed

func CheckRubyAvailable

func CheckRubyAvailable() error

CheckRubyAvailable can be used by callers to verify that ruby is correctly installed

Types

type ERBRenderer

type ERBRenderer struct {
	EvaluationContext *EvaluationContext
	InstanceInfo      *InstanceInfo
	JobSpecFilePath   string
}

ERBRenderer represents a BOSH Job erb template renderer

func NewERBRenderer

func NewERBRenderer(evaluationContext *EvaluationContext, instanceInfo *InstanceInfo, jobSpecFilePath string) *ERBRenderer

NewERBRenderer creates a new ERBRenderer with an EvaluationContext

func (*ERBRenderer) Render

func (e *ERBRenderer) Render(inputFilePath, outputFilePath string) (returnErr error)

Render renders an erb file using an EvaluationContext

type EvaluationContext

type EvaluationContext struct {
	Properties map[string]interface{} `yaml:"properties"`
}

EvaluationContext is the context passed to the erb renderer

type InstanceInfo

type InstanceInfo struct {
	Address    string `yaml:"address"`
	AZ         string `yaml:"az"`
	Bootstrap  bool   `yaml:"bootstrap"`
	Deployment string `yaml:"deployment"`
	ID         string `yaml:"id"`
	Index      int    `yaml:"index"`
	IP         string `yaml:"ip"`
	Name       string `yaml:"name"`
}

InstanceInfo represents instance group runtime information

Jump to

Keyboard shortcuts

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