render

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VersionKey    = "Version"
	NamespaceKey  = "Namespace"
	DomainKey     = "Domain"
	HostedZoneKey = "HostedZone"
	PathKey       = "Path"
	NameKey       = "Name"

	EnvPrefix      = "env:"
	TemplatePrefix = "template:"
	KeyPrefix      = "key:"
	CmdPrefix      = "cmd:"
	FilePrefix     = "file:"

	ValetField  = "valet"
	TemplateTag = "template"
	DefaultTag  = "default"
	KeyTag      = "key"
)

Variables

View Source
var (
	ValueNotFoundError = func(key string) error {
		return errors.Errorf("Value %s not provided", key)
	}
	RequiredValueNotProvidedError = func(key string) error {
		return errors.Errorf("Required value %s not found", key)
	}
)

Functions

func LoadBytesFromUrl

func LoadBytesFromUrl(path string) ([]byte, error)

func LoadTemplate

func LoadTemplate(tmpl string, values Values, runner cmd.Runner) (string, error)

func NewFileStore

func NewFileStore() *fileStore

Types

type FileStore

type FileStore interface {
	Load(path string) (string, error)
	LoadYaml(path string, i interface{}) error
	Save(path, contents string) error
	SaveYaml(path string, i interface{}) error
	Exists(path string) (bool, error)
}

type Flags

type Flags []string

func (Flags) Contains

func (f Flags) Contains(flag string) bool

func (Flags) ToString

func (f Flags) ToString() string

type Values

type Values map[string]string

func (Values) ContainsKey

func (v Values) ContainsKey(key string) bool

func (Values) DeepCopy

func (v Values) DeepCopy() Values

func (Values) GetValue

func (v Values) GetValue(key string, runner cmd_runner.Runner) (string, error)

func (Values) Load

func (v Values) Load(tmpl string, runner cmd_runner.Runner) (string, error)

func (Values) MergeValues

func (v Values) MergeValues(otherValues Values) Values

Returns a copy of v with all of the values from otherValues overriding the original in v

func (Values) Render

func (v Values) Render(runner cmd_runner.Runner) (map[string]interface{}, error)

func (Values) RenderFields

func (v Values) RenderFields(input interface{}, runner cmd_runner.Runner) error

func (Values) RenderStringValues

func (v Values) RenderStringValues(runner cmd_runner.Runner) (map[string]string, error)

func (Values) RenderValues

func (v Values) RenderValues(runner cmd_runner.Runner) (map[string]interface{}, error)

func (Values) ToString

func (v Values) ToString() string

Directories

Path Synopsis
Package mock_render is a generated GoMock package.
Package mock_render is a generated GoMock package.

Jump to

Keyboard shortcuts

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