Skip to content

Commit

Permalink
move packages to pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
tobikris committed Sep 25, 2022
1 parent c091c46 commit 2d09455
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 25 deletions.
11 changes: 6 additions & 5 deletions cmd/terraform-backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"net/http"

"github.com/gorilla/mux"
"github.com/nimbolus/terraform-backend/kms"
"github.com/nimbolus/terraform-backend/terraform"
"github.com/nimbolus/terraform-backend/terraform/auth"
"github.com/nimbolus/terraform-backend/terraform/lock"
"github.com/nimbolus/terraform-backend/terraform/storage"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"

"github.com/nimbolus/terraform-backend/pkg/auth"
"github.com/nimbolus/terraform-backend/pkg/kms"
"github.com/nimbolus/terraform-backend/pkg/lock"
"github.com/nimbolus/terraform-backend/pkg/storage"
"github.com/nimbolus/terraform-backend/pkg/terraform"
)

func httpResponse(w http.ResponseWriter, code int, body string) {
Expand Down
7 changes: 4 additions & 3 deletions terraform/auth/auth.go → pkg/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"fmt"
"net/http"

"github.com/nimbolus/terraform-backend/terraform"
"github.com/nimbolus/terraform-backend/terraform/auth/basic"
"github.com/nimbolus/terraform-backend/terraform/auth/jwt"
"github.com/spf13/viper"

"github.com/nimbolus/terraform-backend/pkg/auth/basic"
"github.com/nimbolus/terraform-backend/pkg/auth/jwt"
"github.com/nimbolus/terraform-backend/pkg/terraform"
)

type Authenticator interface {
Expand Down
2 changes: 1 addition & 1 deletion terraform/auth/basic/basic.go → pkg/auth/basic/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"crypto/sha256"
"fmt"

"github.com/nimbolus/terraform-backend/terraform"
"github.com/nimbolus/terraform-backend/pkg/terraform"
)

type BasicAuth struct{}
Expand Down
3 changes: 2 additions & 1 deletion terraform/auth/jwt/jwt.go → pkg/auth/jwt/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"context"

"github.com/coreos/go-oidc/v3/oidc"
"github.com/nimbolus/terraform-backend/terraform"

"github.com/nimbolus/terraform-backend/pkg/terraform"
)

type JWTAuth struct {
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions kms/kms.go → pkg/kms/kms.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package kms
import (
"fmt"

vaultclient "github.com/nimbolus/terraform-backend/client/vault"
"github.com/nimbolus/terraform-backend/kms/local"
"github.com/nimbolus/terraform-backend/kms/transit"
"github.com/spf13/viper"

vaultclient "github.com/nimbolus/terraform-backend/pkg/client/vault"
"github.com/nimbolus/terraform-backend/pkg/kms/local"
"github.com/nimbolus/terraform-backend/pkg/kms/transit"
)

type KMS interface {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion kms/transit/transit.go → pkg/kms/transit/transit.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/base64"
"fmt"

vaultclient "github.com/nimbolus/terraform-backend/client/vault"
vaultclient "github.com/nimbolus/terraform-backend/pkg/client/vault"
)

type VaultTransit struct {
Expand Down
2 changes: 1 addition & 1 deletion terraform/lock/local/local.go → pkg/lock/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"sync"

"github.com/nimbolus/terraform-backend/terraform"
"github.com/nimbolus/terraform-backend/pkg/terraform"
)

type LocalLock struct {
Expand Down
7 changes: 4 additions & 3 deletions terraform/lock/locker.go → pkg/lock/locker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package lock
import (
"fmt"

"github.com/nimbolus/terraform-backend/terraform"
"github.com/nimbolus/terraform-backend/terraform/lock/local"
"github.com/nimbolus/terraform-backend/terraform/lock/redis"
"github.com/spf13/viper"

"github.com/nimbolus/terraform-backend/pkg/lock/local"
"github.com/nimbolus/terraform-backend/pkg/lock/redis"
"github.com/nimbolus/terraform-backend/pkg/terraform"
)

type Locker interface {
Expand Down
5 changes: 3 additions & 2 deletions terraform/lock/redis/redis.go → pkg/lock/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
"github.com/go-redsync/redsync/v4"
"github.com/go-redsync/redsync/v4/redis"
goredis "github.com/go-redsync/redsync/v4/redis/goredis/v8"
redisclient "github.com/nimbolus/terraform-backend/client/redis"
"github.com/nimbolus/terraform-backend/terraform"

redisclient "github.com/nimbolus/terraform-backend/pkg/client/redis"
"github.com/nimbolus/terraform-backend/pkg/terraform"
)

type RedisLock struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"

"github.com/nimbolus/terraform-backend/terraform"
"github.com/nimbolus/terraform-backend/pkg/terraform"
)

type FileSystemStorage struct {
Expand Down
3 changes: 2 additions & 1 deletion terraform/storage/s3/s3.go → pkg/storage/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (

"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/nimbolus/terraform-backend/terraform"

"github.com/nimbolus/terraform-backend/pkg/terraform"
)

type S3Storage struct {
Expand Down
7 changes: 4 additions & 3 deletions terraform/storage/storage.go → pkg/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package storage
import (
"fmt"

"github.com/nimbolus/terraform-backend/terraform"
"github.com/nimbolus/terraform-backend/terraform/storage/filesystem"
"github.com/nimbolus/terraform-backend/terraform/storage/s3"
"github.com/spf13/viper"

"github.com/nimbolus/terraform-backend/pkg/storage/filesystem"
"github.com/nimbolus/terraform-backend/pkg/storage/s3"
"github.com/nimbolus/terraform-backend/pkg/terraform"
)

type Storage interface {
Expand Down
File renamed without changes.

0 comments on commit 2d09455

Please sign in to comment.