juju: github.com/juju/juju/cloudconfig/providerinit/renderers Index | Files

package renderers

import "github.com/juju/juju/cloudconfig/providerinit/renderers"

The renderers package implements a way to encode the userdata depending on the OS and the provider. It currently holds an interface and common functions, while the implementations live in the particular providers.

Index

Package Files

common.go interface.go

func AddPowershellTags Uses

func AddPowershellTags(udata []byte) []byte

AddPowershellTags adds <powershell>...</powershell> to it's input

func RenderScript Uses

func RenderScript(cfg cloudinit.RenderConfig, ds ...Decorator) ([]byte, error)

RenderScript renders the given cloud-config as a script, and then passes the script through the given decorators.

func RenderYAML Uses

func RenderYAML(cfg cloudinit.RenderConfig, ds ...Decorator) ([]byte, error)

RenderYAML renders the given cloud-config as YAML, and then passes the YAML through the given decorators.

func ToBase64 Uses

func ToBase64(data []byte) []byte

ToBase64 just transforms whatever userdata it gets to base64 format

func WinEmbedInScript Uses

func WinEmbedInScript(udata []byte) []byte

WinEmbedInScript for now is used on windows and it returns a powershell script which has the userdata embedded as base64(gzip(userdata))

type Decorator Uses

type Decorator func([]byte) []byte

Decorator is a function that can be used as part of a rendering pipeline.

type ProviderRenderer Uses

type ProviderRenderer interface {
    Render(cloudinit.CloudConfig, os.OSType) ([]byte, error)
}

ProviderRenderer defines a method to encode userdata depending on the OS and the provider. In the future this might support another method for rendering the userdata differently(bash vs yaml) since some providers might not ship cloudinit on every OS

Package renderers imports 6 packages (graph) and is imported by 230 packages. Updated 2018-05-28. Refresh now. Tools for package owners.