Skip to content

Commit

Permalink
Move packages to internal/
Browse files Browse the repository at this point in the history
  • Loading branch information
viktigpetterr committed Apr 12, 2023
1 parent 958c1ac commit 3f45e91
Show file tree
Hide file tree
Showing 107 changed files with 149 additions and 146 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
retention-days: 2

- name: E2E - scan
run: go run cmd/debricked/main.go scan pkg/file/testdata/misc -e requirements.txt -t ${{ secrets.DEBRICKED_TOKEN }} -r debricked/cli-test -c E2E-test-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
run: go run cmd/debricked/main.go scan internal/file/testdata/misc -e requirements.txt -t ${{ secrets.DEBRICKED_TOKEN }} -r debricked/cli-test -c E2E-test-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}

golangci:
name: Lint
Expand Down
2 changes: 1 addition & 1 deletion cmd/debricked/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"

"github.com/debricked/cli/pkg/cmd/root"
"github.com/debricked/cli/internal/cmd/root"
)

var version string // Set at compile time
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pkg/ci/argo/ci.go → internal/ci/argo/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"regexp"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/util"
"github.com/debricked/cli/pkg/git"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/util"
"github.com/debricked/cli/internal/git"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/ci/argo/ci_test.go → internal/ci/argo/ci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package argo
import (
"testing"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/ci/azure/ci.go → internal/ci/azure/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"path/filepath"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/util"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/util"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/ci/azure/ci_test.go → internal/ci/azure/ci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package azure
import (
"testing"

"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/ci/bitbucket/ci.go → internal/ci/bitbucket/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"os"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/util"
"github.com/debricked/cli/pkg/git"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/util"
"github.com/debricked/cli/internal/git"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package bitbucket
import (
"testing"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/ci/buildkite/ci.go → internal/ci/buildkite/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"regexp"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/util"
"github.com/debricked/cli/pkg/git"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/util"
"github.com/debricked/cli/internal/git"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package buildkite
import (
"testing"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/ci/ci.go → internal/ci/ci.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ci

import "github.com/debricked/cli/pkg/ci/env"
import "github.com/debricked/cli/internal/ci/env"

type ICi interface {
Identify() bool
Expand Down
6 changes: 3 additions & 3 deletions pkg/ci/circleci/ci.go → internal/ci/circleci/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"regexp"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/util"
"github.com/debricked/cli/pkg/git"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/util"
"github.com/debricked/cli/internal/git"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package circleci
import (
"testing"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/ci/github/ci.go → internal/ci/github/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"strings"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/util"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/ci/github/ci_test.go → internal/ci/github/ci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"os"
"testing"

"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/pkg/ci/util"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/debricked/cli/internal/ci/util"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/ci/gitlab/ci.go → internal/ci/gitlab/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package gitlab
import (
"os"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/util"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/util"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/ci/gitlab/ci_test.go → internal/ci/gitlab/ci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gitlab
import (
"testing"

"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
18 changes: 9 additions & 9 deletions pkg/ci/service.go → internal/ci/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import (
"errors"
"fmt"

"github.com/debricked/cli/pkg/ci/argo"
"github.com/debricked/cli/pkg/ci/azure"
"github.com/debricked/cli/pkg/ci/bitbucket"
"github.com/debricked/cli/pkg/ci/buildkite"
"github.com/debricked/cli/pkg/ci/circleci"
"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/github"
"github.com/debricked/cli/pkg/ci/gitlab"
"github.com/debricked/cli/pkg/ci/travis"
"github.com/debricked/cli/internal/ci/argo"
"github.com/debricked/cli/internal/ci/azure"
"github.com/debricked/cli/internal/ci/bitbucket"
"github.com/debricked/cli/internal/ci/buildkite"
"github.com/debricked/cli/internal/ci/circleci"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/github"
"github.com/debricked/cli/internal/ci/gitlab"
"github.com/debricked/cli/internal/ci/travis"
)

type IService interface {
Expand Down
8 changes: 4 additions & 4 deletions pkg/ci/service_test.go → internal/ci/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"os"
"testing"

"github.com/debricked/cli/pkg/ci/azure"
"github.com/debricked/cli/pkg/ci/circleci"
"github.com/debricked/cli/pkg/ci/gitlab"
"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/internal/ci/azure"
"github.com/debricked/cli/internal/ci/circleci"
"github.com/debricked/cli/internal/ci/gitlab"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pkg/ci/travis/ci.go → internal/ci/travis/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"os"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/util"
"github.com/debricked/cli/pkg/git"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/util"
"github.com/debricked/cli/internal/git"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/ci/travis/ci_test.go → internal/ci/travis/ci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package travis
import (
"testing"

"github.com/debricked/cli/pkg/ci/env"
"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/internal/ci/env"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/ci/util/util_test.go → internal/ci/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

"github.com/debricked/cli/pkg/ci/testdata"
"github.com/debricked/cli/internal/ci/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"testing"

testdataClient "github.com/debricked/cli/pkg/client/testdata/client"
testdataClient "github.com/debricked/cli/internal/client/testdata/client"
)

var client *DebClient
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"testing"

testdataClient "github.com/debricked/cli/pkg/client/testdata/client"
testdataClient "github.com/debricked/cli/internal/client/testdata/client"
"github.com/stretchr/testify/assert"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package testdata

import (
"bytes"
"errors"
"io"
"net/http"
"net/url"

"github.com/debricked/cli/pkg/client"
"github.com/debricked/cli/internal/client"
)

type DebClientMock struct {
Expand All @@ -17,6 +18,7 @@ type DebClientMock struct {

func NewDebClientMock() *DebClientMock {
debClient := client.NewDebClient(nil, nil)

return &DebClientMock{
realDebClient: debClient,
responseQueue: []MockResponse{},
Expand Down Expand Up @@ -75,6 +77,7 @@ func (mock *DebClientMock) RemoveQueryParamsFromUri(uri string) string {
q.Del(s)
}
u.RawQuery = q.Encode()

return u.String()
}

Expand Down Expand Up @@ -110,7 +113,7 @@ func (mock *DebClientMock) popResponse(uri string) (*http.Response, error) {
TLS: nil,
}
} else {
return nil, nil
return nil, errors.New("")
}

return &res, responseMock.Error
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/files/files.go → internal/cmd/files/files.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package files

import (
"github.com/debricked/cli/pkg/client"
"github.com/debricked/cli/pkg/cmd/files/find"
"github.com/debricked/cli/pkg/file"
"github.com/debricked/cli/internal/client"
"github.com/debricked/cli/internal/cmd/files/find"
"github.com/debricked/cli/internal/file"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package files
import (
"testing"

"github.com/debricked/cli/pkg/client"
"github.com/debricked/cli/pkg/client/testdata"
"github.com/debricked/cli/internal/client"
"github.com/debricked/cli/internal/client/testdata"
"github.com/stretchr/testify/assert"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"path/filepath"

"github.com/debricked/cli/pkg/file"
"github.com/debricked/cli/internal/file"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"
"testing"

"github.com/debricked/cli/pkg/file"
"github.com/debricked/cli/pkg/file/testdata"
"github.com/debricked/cli/internal/file"
"github.com/debricked/cli/internal/file/testdata"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package license
import (
"fmt"

"github.com/debricked/cli/pkg/report"
"github.com/debricked/cli/pkg/report/license"
"github.com/debricked/cli/internal/report"
"github.com/debricked/cli/internal/report/license"
"github.com/fatih/color"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"testing"

"github.com/debricked/cli/pkg/cmd/report/testdata"
"github.com/debricked/cli/pkg/report"
"github.com/debricked/cli/internal/cmd/report/testdata"
"github.com/debricked/cli/internal/report"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
)
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/report/report.go → internal/cmd/report/report.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package report

import (
"github.com/debricked/cli/pkg/client"
"github.com/debricked/cli/pkg/cmd/report/license"
"github.com/debricked/cli/pkg/cmd/report/vulnerability"
licenseReport "github.com/debricked/cli/pkg/report/license"
vulnerabilityReport "github.com/debricked/cli/pkg/report/vulnerability"
"github.com/debricked/cli/internal/client"
"github.com/debricked/cli/internal/cmd/report/license"
"github.com/debricked/cli/internal/cmd/report/vulnerability"
licenseReport "github.com/debricked/cli/internal/report/license"
vulnerabilityReport "github.com/debricked/cli/internal/report/vulnerability"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
Loading

0 comments on commit 3f45e91

Please sign in to comment.