Skip to content

Commit

Permalink
move backends into own package
Browse files Browse the repository at this point in the history
  • Loading branch information
krysopath committed Aug 23, 2020
1 parent e5eccfd commit 1098a90
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 255 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ GIT_SHA := $(shell git rev-parse --short HEAD 2>/dev/null)
GIT_TAG := $(shell git describe --abbrev=0 HEAD 2>/dev/null)
LD_FLAGS := '-s -w -X main.gitTag=$(GIT_TAG) -X main.gitRef=$(GIT_SHA)'

/usr/bin/token-helper: build/bin/token-helper
sudo cp build/bin/token-helper /usr/bin/token-helper
/usr/bin/vtoh: build/bin/vtoh
sudo cp build/bin/vtoh /usr/bin/vtoh

build/bin/token-helper: *.go go.* deps.txt
go build -ldflags=$(LD_FLAGS) -o build/bin/token-helper
build/bin/vtoh: *.go go.* deps.txt
go build -ldflags=$(LD_FLAGS) -o build/bin/vtoh

deps.txt: go.mod go.sum
go mod tidy
Expand Down
39 changes: 0 additions & 39 deletions file_backend.go

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/krysopath/vtoken-helper
module github.com/krysopath/vtoh

go 1.14

Expand Down
140 changes: 0 additions & 140 deletions gpg_backend.go

This file was deleted.

7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os/user"
"path/filepath"

"github.com/krysopath/vtoh/backends"
"gopkg.in/yaml.v2"
)

Expand Down Expand Up @@ -65,16 +66,16 @@ func (ts *TokenStore) Init() {

switch source.Scheme {
case "file":
backend = FileBackend{FilePath: source.Path}
backend = backends.FileBackend{FilePath: source.Path}
case "gpg":
q := source.Query()
backend = GpgBackend{
backend = backends.GpgBackend{
FilePath: source.Path,
Recipients: q["recipients"],
//KeyRingHome: "/home/gve/src/token-helper/gnupg"}
KeyRingHome: filepath.Join(User.HomeDir, ".token-helper")}
case "s3":
backend = S3Backend{
backend = backends.S3Backend{
Bucket: source.Host,
//Region: "eu-central-1",
Path: source.Path}
Expand Down
68 changes: 0 additions & 68 deletions s3_backend.go

This file was deleted.

0 comments on commit 1098a90

Please sign in to comment.