world

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInsecureRequired = errors.New("This feature requires the --insecure flag")

Functions

This section is empty.

Types

type Env

type Env map[string]string

Env contains a mapping of all environment variables on the system.

type FS

type FS struct {
}

func (*FS) Exists

func (fs *FS) Exists(fpath string) bool

Exists checks if a given path exists and returns true if it does.

type Network

type Network struct {
	// contains filtered or unexported fields
}

Network contains knowledge about the local network.

func (*Network) ExternalIP

func (nw *Network) ExternalIP() string

ExternalIP attempts to determine the host's IP address used to connect to external hosts.

type Options

type Options struct {
	Logger     *logrus.Logger
	Insecure   bool
	LeftDelim  string
	RightDelim string
}

type System

type System struct {

	// OS represents the name of the operating system as exposed by
	// runtime.GOOS.
	OS string

	// Arch represents the name of the current system architecture as exposed
	// by runtime.GOARCH.
	Arch string
	// contains filtered or unexported fields
}

System acts as a container for various info points about the system tpl is executed on.

func (*System) ShellOutput

func (sys *System) ShellOutput(cmd string) (string, error)

ShellOutput starts a shell and executed the given command in it. Note that this feature is locked behind the --insecure flag.

type Vault

type Vault struct {
	Prefix     string
	KeyMapping map[string]string
	// contains filtered or unexported fields
}

func (*Vault) Secret

func (v *Vault) Secret(path, field string) string

type World

type World struct {
	Network Network

	FS FS
	// contains filtered or unexported fields
}

World acts as a container for all the knowledge we want to expose through the template.

func New

func New(opts *Options) *World

New generates ... a new world ...

func (*World) Env

func (w *World) Env() Env

Env lazily loads environment variables.

func (*World) Funcs

func (w *World) Funcs() template.FuncMap

func (*World) Render

func (w *World) Render(out io.Writer, in io.Reader) error

Render takes a template stream as input and converts the world's knowledge through that template into output written to the output stream.

func (*World) System

func (w *World) System() *System

System allows access to various pieces of information regarding the system tpl is executed on.

func (*World) Vault

func (w *World) Vault() *Vault

Jump to

Keyboard shortcuts

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