• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.circleci/H25-Jan-2021-7065

.dependabot/H25-Jan-2021-108

.github/H25-Jan-2021-250224

aws/H25-Jan-2021-1,022810

base64/H25-Jan-2021-6751

cmd/gomplate/H25-Jan-2021-2816

coll/H25-Jan-2021-1,171998

conv/H25-Jan-2021-701577

crypto/H25-Jan-2021-360286

data/H25-Jan-2021-4,3543,639

docs/H25-Jan-2021-11,1158,286

docs-src/content/functions/H25-Jan-2021-4,7364,379

env/H25-Jan-2021-193142

file/H25-Jan-2021-227181

funcs/H25-Jan-2021-4,4323,370

gcp/H25-Jan-2021-13292

hooks/H25-Jan-2021-8363

internal/H25-Jan-2021-7,1955,982

libkv/H25-Jan-2021-503406

math/H25-Jan-2021-7859

net/H25-Jan-2021-11187

random/H25-Jan-2021-240188

regexp/H25-Jan-2021-172140

strings/H25-Jan-2021-244163

test/H25-Jan-2021-9368

time/H25-Jan-2021-4932

tmpl/H25-Jan-2021-195154

vault/H25-Jan-2021-487384

vendor/H03-May-2022-17,907,33612,604,260

version/H25-Jan-2021-146

.dockerignoreH A D25-Jan-202185 109

.gitignoreH A D25-Jan-202149 87

.golangci.ymlH A D25-Jan-20211.6 KiB8683

.imgbotconfigH A D25-Jan-202185 54

CHANGELOG.mdH A D25-Jan-202148.3 KiB674453

CONTRIBUTING.mdH A D25-Jan-20214.5 KiB6243

DockerfileH A D25-Jan-20213.1 KiB10876

Dockerfile.integrationH A D25-Jan-2021419 1811

LICENSEH A D25-Jan-20211.1 KiB2217

MakefileH A D25-Jan-20217.3 KiB215165

README.mdH A D25-Jan-20216.4 KiB146110

cleanup.goH A D25-Jan-2021213 1410

config.goH A D25-Jan-20213 KiB146120

config_test.goH A D25-Jan-2021793 4938

context.goH A D25-Jan-2021796 3931

context_test.goH A D25-Jan-20211.5 KiB6152

funcs.goH A D25-Jan-20211.5 KiB5242

go.modH A D25-Jan-20211.3 KiB3835

go.sumH A D25-Jan-202189.6 KiB930929

gomplate.goH A D25-Jan-20214.9 KiB224189

gomplate_test.goH A D25-Jan-20217.1 KiB257224

metrics.goH A D25-Jan-2021883 2516

plugins.goH A D25-Jan-20212.5 KiB11893

plugins_test.goH A D25-Jan-20211.8 KiB7767

renovate.jsonH A D25-Jan-2021588 3534

template.goH A D25-Jan-20217.2 KiB298237

template_test.goH A D25-Jan-20217.1 KiB266229

template_unix.goH A D25-Jan-2021205 1812

template_unix_test.goH A D25-Jan-2021961 4433

template_windows.goH A D25-Jan-2021224 1812

template_windows_test.goH A D25-Jan-2021986 4433

README.md

1<img src="docs/static/images/gomplate.png" width="512px" alt="gomplate logo"/>
2
3_Read the docs at [docs.gomplate.ca][docs-url], chat with developers and community in the [#gomplate channel][] on [Gophers Slack][]_
4
5[![Build Status][circleci-image]][circleci-url]
6[![Build][gh-actions-image]][gh-actions-url]
7[![Go Report Card][reportcard-image]][reportcard-url]
8[![Codebeat Status][codebeat-image]][codebeat-url]
9[![Coverage][gocover-image]][gocover-url]
10[![Total Downloads][gh-downloads-image]][gh-downloads-url]
11[![CII Best Practices][cii-bp-image]][cii-bp-url]
12
13[![hairyhenderson/gomplate on DockerHub][dockerhub-image]][dockerhub-url]
14[![DockerHub Stars][dockerhub-stars-image]][dockerhub-url]
15[![DockerHub Pulls][dockerhub-pulls-image]][dockerhub-url]
16[![DockerHub Image Layers][microbadger-layers-image]][microbadger-url]
17[![DockerHub Latest Version ][microbadger-version-image]][microbadger-url]
18[![DockerHub Latest Commit][microbadger-commit-image]][microbadger-url]
19
20[![Install Docs][install-docs-image]][install-docs-url]
21[![Slack][slack-image]][slack-url]
22[![Discussions][discussions-image]][discussions-url]
23
24`gomplate` is a template renderer which supports a growing list of datasources,
25such as: JSON (_including EJSON - encrypted JSON_), YAML, AWS EC2 metadata, [BoltDB](https://pkg.go.dev/go.etcd.io/bbolt),
26[Hashicorp Consul](https://www.consul.io/) and [Hashicorp Vault](https://www.vaultproject.io/) secrets.
27
28Come chat with developers and community in the [#gomplate channel][] on [Gophers Slack][] and on [GitHub Discussions][discussions-url]!
29
30Here are some hands-on examples of how `gomplate` works:
31
32```console
33$ # at its most basic, gomplate can be used with environment variables...
34$ echo 'Hello, {{ .Env.USER }}' | gomplate
35Hello, hairyhenderson
36
37$ # but that's kind of boring. gomplate has tons of functions to do useful stuff, too
38$ gomplate -i 'the answer is: {{ mul 6 7 }}'
39the answer is: 42
40
41$ # and, since gomplate uses Go's templating syntax, you can do fun things like:
42$ gomplate -i '{{ range seq 5 1 }}{{ . }} {{ if eq . 1 }}{{ "blastoff" | toUpper }}{{ end }}{{ end }}'
435 4 3 2 1 BLASTOFF
44
45$ # the real fun comes when you use datasources!
46$ cat ./config.yaml
47foo:
48  bar:
49    baz: qux
50$ gomplate -d config=./config.yaml -i 'the value we want is: {{ (datasource "config").foo.bar.baz }}'
51the value we want is: qux
52
53$ # datasources are defined by URLs, and gomplate is not limited to just file-based datasources:
54$ gomplate -d ip=https://ipinfo.io -i 'country code: {{ (ds "ip").country }}'
55country code: CA
56
57$ # standard input can be used as a datasource too:
58$ echo '{"cities":["London", "Johannesburg", "Windhoek"]}' | gomplate -d city=stdin:///in.json -i '{{ range (ds "city").cities }}{{.}}, {{end}}'
59London, Johannesburg, Windhoek,
60
61$ # and here's something a little more complicated:
62$ export CITIES='city: [London, Johannesburg, Windhoek]'
63$ cat in.tmpl
64{{ range $i, $city := (ds "cities").city -}}
65{{ add 1 $i }}: {{ include "weather" (print $city "?0") }}
66{{ end }}
67$ gomplate -d 'cities=env:///CITIES?type=application/yaml' -d 'weather=https://wttr.in/?0' -H 'weather=User-Agent: curl' -f in.tmpl
681: Weather report: London
69
70    \  /       Partly cloudy
71  _ /"".-.     4-7 °C
72    \_(   ).   ↑ 20 km/h
73    /(___(__)  10 km
74               0.0 mm
75
762: Weather report: Johannesburg
77
78    \  /       Partly cloudy
79  _ /"".-.     15 °C
80    \_(   ).   ↘ 0 km/h
81    /(___(__)  10 km
82               2.2 mm
83
843: Weather report: Windhoek
85
86    \  /       Partly cloudy
87  _ /"".-.     20 °C
88    \_(   ).   ↑ 6 km/h
89    /(___(__)  20 km
90               0.0 mm
91```
92
93Read the documentation at [docs.gomplate.ca][docs-url], and join the discussion
94in [GitHub Discussions][discussions-url]!
95
96_Please report any bugs found in the [issue tracker](https://github.com/hairyhenderson/gomplate/issues/)._
97
98## License
99
100[The MIT License](http://opensource.org/licenses/MIT)
101
102Copyright (c) 2016-2021 Dave Henderson
103
104[circleci-image]: https://img.shields.io/circleci/project/github/hairyhenderson/gomplate/master.svg?logo=circleci
105[circleci-url]: https://circleci.com/gh/hairyhenderson/gomplate/tree/master
106
107[gh-actions-image]: https://github.com/hairyhenderson/gomplate/workflows/Build/badge.svg?branch=master
108[gh-actions-url]: https://github.com/hairyhenderson/gomplate/actions?workflow=Build&branch=master
109
110[reportcard-image]: https://goreportcard.com/badge/github.com/hairyhenderson/gomplate
111[reportcard-url]: https://goreportcard.com/report/github.com/hairyhenderson/gomplate
112[codebeat-image]: https://codebeat.co/badges/39ed2148-4b86-4d1e-8526-25f60e159ba1
113[codebeat-url]: https://codebeat.co/projects/github-com-hairyhenderson-gomplate
114[gocover-image]: https://gocover.io/_badge/github.com/hairyhenderson/gomplate
115[gocover-url]: https://gocover.io/github.com/hairyhenderson/gomplate
116[gh-downloads-image]: https://img.shields.io/github/downloads/hairyhenderson/gomplate/total.svg
117[gh-downloads-url]: https://github.com/hairyhenderson/gomplate/releases
118
119[cii-bp-image]: https://bestpractices.coreinfrastructure.org/projects/337/badge
120[cii-bp-url]: https://bestpractices.coreinfrastructure.org/projects/337
121
122[dockerhub-image]: https://img.shields.io/badge/docker-ready-blue.svg
123[dockerhub-url]: https://hub.docker.com/r/hairyhenderson/gomplate
124[dockerhub-stars-image]: https://img.shields.io/docker/stars/hairyhenderson/gomplate.svg
125[dockerhub-pulls-image]: https://img.shields.io/docker/pulls/hairyhenderson/gomplate.svg
126
127[microbadger-version-image]: https://images.microbadger.com/badges/version/hairyhenderson/gomplate.svg
128[microbadger-layers-image]: https://images.microbadger.com/badges/image/hairyhenderson/gomplate.svg
129[microbadger-commit-image]: https://images.microbadger.com/badges/commit/hairyhenderson/gomplate.svg
130[microbadger-url]: https://microbadger.com/image/hairyhenderson/gomplate
131
132[docs-url]: https://docs.gomplate.ca
133[install-docs-image]: https://img.shields.io/badge/install-docs-blue.svg
134[install-docs-url]: https://docs.gomplate.ca/installing
135
136[Gophers Slack]: https://invite.slack.golangbridge.org
137[#gomplate channel]: https://gophers.slack.com/messages/CGTR16RM2/
138
139[slack-image]: https://img.shields.io/badge/slack-gophers/%23gomplate-00ADD8.svg?logo=slack
140[slack-url]: https://gophers.slack.com/messages/CGTR16RM2/
141
142[discussions-image]: https://img.shields.io/badge/discussions-gomplate-blue.svg?logo=github
143[discussions-url]: https://github.com/hairyhenderson/gomplate/discussions
144
145[![Analytics](https://ga-beacon.appspot.com/UA-82637990-1/gomplate/README.md?pixel)](https://github.com/igrigorik/ga-beacon)
146