tmpl

package module
v0.0.0-...-eb53f8d Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2019 License: MIT Imports: 12 Imported by: 0

README

tmpl

A tool for generating parameterized files from templates.

Install

Binary downloads can be found on releases page.

Or install it manually:

go get github.com/tinrab/tmpl/cmd/tmpl

Usage

Example:

$ tmpl -p "./test/simple/*.params.*" -s ./test/simple/deployment.tmpl.yaml -t

Help:

A tool for generating parameterized files from templates

Usage:
  tmpl [flags]
  tmpl [command]

Available Commands:
  help        Help about any command
  version     Print version

Flags:
      --consul-address string   consul address
      --consul-token string     consul token
  -d, --delimiter string        template delimiter (default "\n")
  -h, --help                    help for tmpl
  -o, --output string           output file path (default "tmpl.out")
  -p, --parameters string       path to parameters
  -s, --source string           path to sources
  -t, --test                    print result to stdout

Use "tmpl [command] --help" for more information about a command.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulConfig

type ConsulConfig struct {
	Address string
	Token   string
}

type Options

type Options struct {
	Parameters   ParameterMap
	Sources      []Source
	ConsulConfig *ConsulConfig
	VaultConfig  *VaultConfig
}

type ParameterMap

type ParameterMap map[string]interface{}

func LoadParameters

func LoadParameters(path string) (ParameterMap, error)

type Result

type Result struct {
	Name string
	Data []byte
}

func Generate

func Generate(options Options) ([]Result, error)

type Source

type Source struct {
	Name  string
	Value string
}

func LoadSources

func LoadSources(path string) ([]Source, error)

type VaultConfig

type VaultConfig struct {
	Address string
	Token   string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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