Skip to content

Commit

Permalink
Move to package
Browse files Browse the repository at this point in the history
  • Loading branch information
stuart-c committed Aug 2, 2017
1 parent 1fbf8f1 commit 8dedf5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions data.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"time"

"github.com/blang/vfs"
"github.com/hairyhenderson/gomplate/libkv"
"github.com/hairyhenderson/gomplate/vault"
)

Expand Down Expand Up @@ -89,7 +90,7 @@ type Source struct {
FS vfs.Filesystem // used for file: URLs, nil otherwise
HC *http.Client // used for http[s]: URLs, nil otherwise
VC *vault.Client //used for vault: URLs, nil otherwise
KV *LibKV // used for consul:, etcd:, zookeeper: & boltdb: URLs, nil otherwise
KV *libkv.LibKV // used for consul:, etcd:, zookeeper: & boltdb: URLs, nil otherwise
Header http.Header // used for http[s]: URLs, nil otherwise
}

Expand Down Expand Up @@ -336,7 +337,7 @@ func readVault(source *Source, args ...string) ([]byte, error) {

func readLibKV(source *Source, args ...string) ([]byte, error) {
if source.KV == nil {
source.KV = NewLibKV(source.URL)
source.KV = libkv.New(source.URL)
err := source.KV.Login()
addCleanupHook(source.KV.Logout)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions libkv.go → libkv/libkv.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package libkv

import (
"crypto/tls"
Expand Down Expand Up @@ -34,8 +34,8 @@ type SetupDetails struct {
options *store.Config
}

// NewLibKV - instantiate a new
func NewLibKV(url *url.URL) *LibKV {
// New - instantiate a new
func New(url *url.URL) *LibKV {
var s *SetupDetails

if url.Scheme == "consul" {
Expand Down

0 comments on commit 8dedf5d

Please sign in to comment.