gomplate

package module
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 12 Imported by: 0

README

gomplate logo

Read the docs at gomplate.hairyhenderson.ca.

Build Status Windows Build Go Report Card Codebeat Status Coverage Total Downloads CII Best Practices

hairyhenderson/gomplate on DockerHub DockerHub Stars DockerHub Pulls DockerHub Image Layers DockerHub Latest Version DockerHub Latest Commit

Install Docs

A Go template-based CLI tool. gomplate can be used as an alternative to envsubst but also supports additional template datasources such as: JSON, YAML, AWS EC2 metadata, BoltDB, Hashicorp Consul and Hashicorp Vault secrets.

I really like envsubst for use as a super-minimalist template processor. But its simplicity is also its biggest flaw: it's all-or-nothing with shell-like variables.

Gomplate is an alternative that will let you process templates which also include shell-like variables. Also there are some useful built-in functions that can be used to make templates even more expressive.

Read more documentation at gomplate.hairyhenderson.ca!

Please report any bugs found in the issue tracker.

Releasing

Right now the release process is semi-automatic.

  1. Create a release tag: git tag -a v0.0.9 -m "Releasing v0.9.9" && git push --tags
  2. Build binaries & compress most of them: make build-release
  3. Create a release in github!

License

The MIT License

Copyright (c) 2016-2018 Dave Henderson

Analytics

Documentation

Index

Constants

This section is empty.

Variables

Stdout allows overriding the writer to use when templates are written to stdout ("-").

Functions

func Funcs added in v2.8.0

func Funcs(d *data.Data) template.FuncMap

Funcs - The function mappings are defined here!

func RunTemplates added in v2.5.0

func RunTemplates(o *Config) error

RunTemplates - run all gomplate templates specified by the given configuration

Types

type Config added in v2.5.0

type Config struct {
	Input       string
	InputFiles  []string
	InputDir    string
	ExcludeGlob []string
	OutputFiles []string
	OutputDir   string
	OutMode     string

	DataSources       []string
	DataSourceHeaders []string

	LDelim string
	RDelim string
}

Config - values necessary for rendering templates with gomplate. Mainly for use by the CLI

func (*Config) String added in v2.8.0

func (o *Config) String() string

nolint: gocyclo

type MetricsType added in v2.5.0

type MetricsType struct {
	TemplatesGathered   int
	TemplatesProcessed  int
	Errors              int
	GatherDuration      time.Duration            // time it took to gather templates
	TotalRenderDuration time.Duration            // time it took to render all templates
	RenderDuration      map[string]time.Duration // times for rendering each template
}

MetricsType - Warning: experimental! This may change in breaking ways without warning. This is not subject to any semantic versioning guarantees!

var Metrics *MetricsType

Metrics tracks interesting basic metrics around gomplate executions. Warning: experimental! This may change in breaking ways without warning. This is not subject to any semantic versioning guarantees!

Directories

Path Synopsis
cmd
tests

Jump to

Keyboard shortcuts

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