From c5fc7b8bad34f649b7a7198c2660b5d6decef8e1 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Fri, 13 May 2022 16:04:19 -0700 Subject: Remove BoltDB support Signed-off-by: Dave Henderson --- data/datasource.go | 4 +--- data/datasource_boltdb.go | 32 -------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 data/datasource_boltdb.go (limited to 'data') diff --git a/data/datasource.go b/data/datasource.go index a28a66f7..a8ce5e74 100644 --- a/data/datasource.go +++ b/data/datasource.go @@ -42,8 +42,6 @@ func (d *Data) registerReaders() { d.sourceReaders["aws+smp"] = readAWSSMP d.sourceReaders["aws+sm"] = readAWSSecretsManager - // Deprecated: don't use - d.sourceReaders["boltdb"] = readBoltDB d.sourceReaders["consul"] = readConsul d.sourceReaders["consul+http"] = readConsul d.sourceReaders["consul+https"] = readConsul @@ -148,7 +146,7 @@ type Source struct { fs afero.Fs // used for file: URLs, nil otherwise hc *http.Client // used for http[s]: URLs, nil otherwise vc *vault.Vault // used for vault: URLs, nil otherwise - kv *libkv.LibKV // used for consul:, etcd:, zookeeper: & boltdb: URLs, nil otherwise + kv *libkv.LibKV // used for consul:, etcd:, zookeeper: URLs, nil otherwise asmpg awssmpGetter // used for aws+smp:, nil otherwise awsSecretsManager awsSecretsManagerGetter // used for aws+sm, nil otherwise mediaType string diff --git a/data/datasource_boltdb.go b/data/datasource_boltdb.go deleted file mode 100644 index 63be1e64..00000000 --- a/data/datasource_boltdb.go +++ /dev/null @@ -1,32 +0,0 @@ -package data - -import ( - "context" - - "github.com/hairyhenderson/gomplate/v3/internal/deprecated" - "github.com/hairyhenderson/gomplate/v3/libkv" - "github.com/pkg/errors" -) - -// Deprecated: don't use -func readBoltDB(ctx context.Context, source *Source, args ...string) (data []byte, err error) { - deprecated.WarnDeprecated(ctx, "boltdb support is deprecated and will be removed in a future major version of gomplate") - if source.kv == nil { - source.kv, err = libkv.NewBoltDB(source.URL) - if err != nil { - return nil, err - } - } - - if len(args) != 1 { - return nil, errors.New("missing key") - } - p := args[0] - - data, err = source.kv.Read(p) - if err != nil { - return nil, err - } - - return data, nil -} -- cgit v1.2.3