Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 19 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
module github.com/kelseyhightower/confd

go 1.19
go 1.23.0

toolchain go1.23.5

require (
github.com/BurntSushi/toml v0.3.1
github.com/Masterminds/sprig/v3 v3.2.3
github.com/aws/aws-sdk-go v1.44.107
github.com/fsnotify/fsnotify v1.5.4
github.com/garyburd/redigo v1.6.4
Expand All @@ -17,6 +20,10 @@ require (
)

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
Expand All @@ -26,6 +33,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v0.16.2 // indirect
Expand All @@ -45,27 +53,31 @@ require (
github.com/hashicorp/serf v0.9.7 // indirect
github.com/hashicorp/vault/sdk v0.6.0 // indirect
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/mattn/go-colorable v0.1.6 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/pierrec/lz4 v2.5.2+incompatible // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
go.etcd.io/etcd/api/v3 v3.5.5 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.26.0 // indirect
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/grpc v1.41.0 // indirect
Expand Down
56 changes: 56 additions & 0 deletions go.sum

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions resource/template/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"text/template"

"github.com/BurntSushi/toml"
"github.com/Masterminds/sprig/v3"
"github.com/kelseyhightower/confd/backends"
"github.com/kelseyhightower/confd/log"
util "github.com/kelseyhightower/confd/util"
Expand Down Expand Up @@ -85,6 +86,12 @@ func NewTemplateResource(path string, config Config) (*TemplateResource, error)
tr.funcMap = newFuncMap()
tr.store = memkv.New()
tr.syncOnly = config.SyncOnly
sprigFuncMap := sprig.TxtFuncMap()

for funcName, sprigFunc := range sprigFuncMap {
addFunc(tr.funcMap, "sprig"+strings.Title(funcName), sprigFunc)
}

addFuncs(tr.funcMap, tr.store.FuncMap)

if config.Prefix != "" {
Expand Down
4 changes: 4 additions & 0 deletions resource/template/template_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func newFuncMap() map[string]interface{} {
return m
}

func addFunc(out map[string]interface{}, fName string, fBody interface{}) {
out[fName] = fBody
}

func addFuncs(out, in map[string]interface{}) {
for name, fn := range in {
out[name] = fn
Expand Down
18 changes: 18 additions & 0 deletions vendor/github.com/Masterminds/goutils/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/github.com/Masterminds/goutils/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

202 changes: 202 additions & 0 deletions vendor/github.com/Masterminds/goutils/LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading