Skip to content

Commit

Permalink
refactor package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
redradrat committed Oct 15, 2020
1 parent c8138d3 commit 0e8b47b
Show file tree
Hide file tree
Showing 21 changed files with 23 additions and 24 deletions.
7 changes: 3 additions & 4 deletions cmd/addRepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import (
"os"
"regexp"

"github.com/redradrat/kable/repositories"

errors2 "github.com/redradrat/kable/errors"
kableerrors "github.com/redradrat/kable/pkg/errors"
"github.com/redradrat/kable/pkg/repositories"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -62,7 +61,7 @@ var addRepoCmd = &cobra.Command{
}
err = repositories.AddAuthRepository(name, repoUrl, user, pw, "master")
if err != nil {
if !errors.Is(err, errors2.RepositoryAlreadyExistsError) {
if !errors.Is(err, kableerrors.RepositoryAlreadyExistsError) {
PrintError("unable to add repository: %s", err)
} else {
PrintSuccess("Repository already configured!")
Expand Down
2 changes: 1 addition & 1 deletion cmd/helmConcept.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package cmd
import (
"errors"

"github.com/redradrat/kable/helm"
"github.com/redradrat/kable/pkg/helm"

"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/helmImport.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package cmd
import (
"errors"

"github.com/redradrat/kable/concepts"
"github.com/redradrat/kable/pkg/concepts"

"github.com/redradrat/kable/helm"
"github.com/redradrat/kable/pkg/helm"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/initConcept.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"os"
"path/filepath"

"github.com/redradrat/kable/concepts"
"github.com/redradrat/kable/pkg/concepts"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/inputDialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/AlecAivazis/survey/v2"

"github.com/redradrat/kable/concepts"
"github.com/redradrat/kable/pkg/concepts"
)

type InputDialog struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/listConcept.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
package cmd

import (
concepts2 "github.com/redradrat/kable/concepts"
concepts2 "github.com/redradrat/kable/pkg/concepts"
"github.com/spf13/cobra"
)

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

"github.com/redradrat/kable/repositories"
"github.com/redradrat/kable/pkg/repositories"
"github.com/spf13/cobra"
)

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

"github.com/redradrat/kable/repositories"
"github.com/redradrat/kable/pkg/repositories"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/renderConcept.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"os"
"path/filepath"

"github.com/redradrat/kable/concepts"
"github.com/redradrat/kable/pkg/concepts"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"fmt"
"os"

"github.com/redradrat/kable/config"
"github.com/redradrat/kable/pkg/config"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/tidyRepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
package cmd

import (
"github.com/redradrat/kable/repositories"
"github.com/redradrat/kable/pkg/repositories"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/updateRepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
package cmd

import (
"github.com/redradrat/kable/repositories"
"github.com/redradrat/kable/pkg/repositories"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions concepts/concepts.go → pkg/concepts/concepts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"regexp"
"strings"

"github.com/redradrat/kable/repositories"
"github.com/redradrat/kable/pkg/repositories"

"github.com/redradrat/kable/errors"
"github.com/redradrat/kable/pkg/errors"

"github.com/go-git/go-git/v5"
giturls "github.com/whilp/git-urls"
Expand Down
2 changes: 1 addition & 1 deletion concepts/rendering.go → pkg/concepts/rendering.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"
"time"

"github.com/redradrat/kable/errors"
"github.com/redradrat/kable/pkg/errors"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion concepts/targets.go → pkg/concepts/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/grafana/tanka/pkg/process"
"github.com/grafana/tanka/pkg/tanka"

"github.com/redradrat/kable/errors"
"github.com/redradrat/kable/pkg/errors"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion config/config.go → pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"path/filepath"

"github.com/redradrat/kable/errors"
"github.com/redradrat/kable/pkg/errors"

"github.com/mitchellh/go-homedir"
)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion helm/import.go → pkg/helm/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/grafana/tanka/pkg/helm"

"github.com/redradrat/kable/concepts"
"github.com/redradrat/kable/pkg/concepts"

"github.com/jsonnet-bundler/jsonnet-bundler/spec/v1/deps"

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

"github.com/go-git/go-git/v5/plumbing/transport/http"

"github.com/redradrat/kable/config"
"github.com/redradrat/kable/pkg/config"

errors2 "github.com/redradrat/kable/errors"
errors2 "github.com/redradrat/kable/pkg/errors"

"github.com/google/uuid"

Expand Down

0 comments on commit 0e8b47b

Please sign in to comment.