Skip to content

Commit

Permalink
restructure repo to clean up top-level (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksanders authored Aug 6, 2021
1 parent 19c4745 commit 6a530ff
Show file tree
Hide file tree
Showing 54 changed files with 92 additions and 111 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
args: -f build/.goreleaser.yml release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
7 changes: 4 additions & 3 deletions .goreleaser.yml → build/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ builds:
- -trimpath
ldflags:
- -s -w -extldflags "-static"
-X github.com/netflix/weep/metadata.Version={{.Version}}
-X github.com/netflix/weep/metadata.Commit={{.CommitDate}}
-X github.com/netflix/weep/metadata.Date={{.Date}}
-X github.com/netflix/weep/internal/metadata.Version={{.Version}}
-X github.com/netflix/weep/internal/metadata.Commit={{.CommitDate}}
-X github.com/netflix/weep/internal/metadata.Date={{.Date}}
mod_timestamp: '{{ .CommitTimestamp }}'
-
id: demo
Expand Down Expand Up @@ -71,6 +71,7 @@ dockers:
-
goos: linux
goarch: amd64
dockerfile: build/Dockerfile
ids:
- default
image_templates:
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions cmd/credential_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import (
"fmt"
"time"

"github.com/netflix/weep/util"
"github.com/netflix/weep/internal/creds"
"github.com/netflix/weep/internal/util"

"gopkg.in/ini.v1"

"github.com/netflix/weep/creds"
"github.com/spf13/cobra"
)

Expand Down
3 changes: 2 additions & 1 deletion cmd/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import (
"os"
"strings"

"github.com/netflix/weep/creds"
"github.com/netflix/weep/internal/creds"

"github.com/spf13/cobra"
)

Expand Down
5 changes: 3 additions & 2 deletions cmd/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import (
"strconv"
"time"

"github.com/netflix/weep/internal/creds"
"github.com/netflix/weep/internal/util"

"gopkg.in/ini.v1"

"github.com/mitchellh/go-homedir"
"github.com/netflix/weep/creds"
"github.com/netflix/weep/util"
"github.com/spf13/cobra"
)

Expand Down
5 changes: 3 additions & 2 deletions cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"os"
"strings"

"github.com/netflix/weep/internal/metadata"

"gopkg.in/yaml.v2"

"github.com/netflix/weep/metadata"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down Expand Up @@ -97,10 +98,10 @@ func DecodeWeepInfo(args []string, w io.Writer) error {
}
b64decoder := base64.NewDecoder(base64.StdEncoding, r)
zreader, err := zlib.NewReader(b64decoder)
defer zreader.Close()
if err != nil {
return err
}
defer zreader.Close()

io.Copy(w, zreader)

Expand Down
3 changes: 2 additions & 1 deletion cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import (
"os"
"strings"

"github.com/netflix/weep/creds"
"github.com/netflix/weep/internal/creds"

"github.com/spf13/cobra"
)

Expand Down
5 changes: 3 additions & 2 deletions cmd/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package cmd
import (
"errors"

"github.com/netflix/weep/creds"
"github.com/netflix/weep/util"
"github.com/netflix/weep/internal/creds"
"github.com/netflix/weep/internal/util"

"github.com/spf13/cobra"
)

Expand Down
7 changes: 3 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ import (
"os/signal"
"syscall"

"github.com/netflix/weep/metadata"

"github.com/netflix/weep/config"
"github.com/netflix/weep/logging"
"github.com/netflix/weep/internal/config"
"github.com/netflix/weep/internal/logging"
"github.com/netflix/weep/internal/metadata"

"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
package cmd

import (
"github.com/netflix/weep/internal/server"
"github.com/spf13/viper"

"github.com/netflix/weep/server"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package cmd
import (
"fmt"

"github.com/netflix/weep/metadata"
"github.com/netflix/weep/internal/metadata"

"github.com/spf13/cobra"
)
Expand Down
File renamed without changes.
19 changes: 0 additions & 19 deletions embedded.go

This file was deleted.

6 changes: 3 additions & 3 deletions cache/cache.go → internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"strings"
"sync"

"github.com/netflix/weep/logging"
"github.com/netflix/weep/internal/creds"
"github.com/netflix/weep/internal/errors"
"github.com/netflix/weep/internal/logging"

"github.com/netflix/weep/creds"
"github.com/netflix/weep/errors"
"github.com/sirupsen/logrus"
)

Expand Down
4 changes: 2 additions & 2 deletions cache/cache_test.go → internal/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"testing"
"time"

"github.com/netflix/weep/creds"
"github.com/netflix/weep/errors"
"github.com/netflix/weep/internal/creds"
"github.com/netflix/weep/internal/errors"
)

func TestCredentialCache_Get(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion config/config.go → internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"path/filepath"
"runtime"

"github.com/netflix/weep/logging"
"github.com/netflix/weep/internal/logging"

"github.com/mitchellh/go-homedir"
"github.com/pkg/errors"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 5 additions & 7 deletions creds/consoleme.go → internal/creds/consoleme.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ import (
"strings"
"time"

"github.com/netflix/weep/metadata"
werrors "github.com/netflix/weep/internal/errors"
"github.com/netflix/weep/internal/httpAuth/challenge"
"github.com/netflix/weep/internal/httpAuth/mtls"
"github.com/netflix/weep/internal/logging"
"github.com/netflix/weep/internal/metadata"

"github.com/netflix/weep/logging"

werrors "github.com/netflix/weep/errors"
"github.com/spf13/viper"

"github.com/netflix/weep/httpAuth/challenge"
"github.com/netflix/weep/httpAuth/mtls"

"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions creds/refreshable.go → internal/creds/refreshable.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (
"strings"
"time"

"github.com/netflix/weep/internal/errors"

"github.com/sirupsen/logrus"

"github.com/spf13/viper"

"github.com/netflix/weep/errors"

"github.com/aws/aws-sdk-go/aws/credentials"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"testing"
"time"

"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/netflix/weep/internal/errors"

"github.com/netflix/weep/errors"
"github.com/aws/aws-sdk-go/aws/credentials"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion creds/types.go → internal/creds/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sync"
"time"

"github.com/netflix/weep/metadata"
"github.com/netflix/weep/internal/metadata"

"github.com/aws/aws-sdk-go/aws/credentials"
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ import (
"syscall"
"time"

"github.com/mitchellh/go-homedir"
"github.com/netflix/weep/internal/config"
"github.com/netflix/weep/internal/util"

"github.com/netflix/weep/config"
"github.com/mitchellh/go-homedir"

"github.com/manifoldco/promptui"

"github.com/spf13/viper"

"github.com/golang/glog"
"github.com/netflix/weep/util"
log "github.com/sirupsen/logrus"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"syscall"
"time"

"github.com/netflix/weep/metadata"
"github.com/netflix/weep/internal/metadata"

"github.com/sirupsen/logrus"

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions httpAuth/mtls/mtls.go → internal/httpAuth/mtls/mtls.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import (
"io/ioutil"
"net/http"

"github.com/netflix/weep/logging"
"github.com/netflix/weep/internal/config"
"github.com/netflix/weep/internal/logging"
"github.com/netflix/weep/internal/util"

"github.com/spf13/viper"

Expand All @@ -32,8 +34,6 @@ import (
"strings"

"github.com/mitchellh/go-homedir"
"github.com/netflix/weep/config"
"github.com/netflix/weep/util"
)

var log = logging.GetLogger()
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion metadata/metadata.go → internal/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os/user"
"time"

"github.com/netflix/weep/logging"
"github.com/netflix/weep/internal/logging"
)

var (
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion metadata/version.go → internal/metadata/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"fmt"

"github.com/netflix/weep/config"
"github.com/netflix/weep/internal/config"
)

var (
Expand Down
5 changes: 2 additions & 3 deletions server/baseHandler.go → internal/server/baseHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ import (
"fmt"
"net/http"

"github.com/netflix/weep/util"

"github.com/netflix/weep/logging"
"github.com/netflix/weep/internal/logging"
"github.com/netflix/weep/internal/util"
)

var log = logging.GetLogger()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import (
"fmt"
"net/http"

"github.com/netflix/weep/util"

"github.com/netflix/weep/cache"
"github.com/netflix/weep/internal/cache"
"github.com/netflix/weep/internal/util"
)

func RoleHandler(w http.ResponseWriter, r *http.Request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
"net/http"
"strings"

"github.com/aws/aws-sdk-go/aws/arn"
"github.com/netflix/weep/cache"
"github.com/netflix/weep/util"
"github.com/netflix/weep/internal/cache"
"github.com/netflix/weep/internal/creds"
"github.com/netflix/weep/internal/util"

"github.com/aws/aws-sdk-go/aws/arn"
"github.com/gorilla/mux"
"github.com/netflix/weep/creds"
)

// parseAssumeRoleQuery extracts the assume query string argument, splits it on commas, validates that each element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"net/http"

"github.com/netflix/weep/health"
"github.com/netflix/weep/internal/health"
)

type healthcheckResponse struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ import (
"encoding/json"
"net/http"

"github.com/netflix/weep/cache"

"github.com/netflix/weep/util"
"github.com/netflix/weep/internal/cache"
"github.com/netflix/weep/internal/util"
)

func IamInfoHandler(w http.ResponseWriter, r *http.Request) {
Expand Down
Loading

0 comments on commit 6a530ff

Please sign in to comment.