Skip to content

Commit

Permalink
refactor: command package (#536)
Browse files Browse the repository at this point in the history
* refactor: move connectivity to internal

* refactor: move logger to internal

* refactor: move progressbar to internal

* refactor: move survey to internal

* refactor: move server to root
  • Loading branch information
deryrahman authored Aug 24, 2022
1 parent 7710e0e commit a96503a
Show file tree
Hide file tree
Showing 54 changed files with 78 additions and 78 deletions.
4 changes: 2 additions & 2 deletions cmd/admin/build_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
"github.com/odpf/optimus/utils"
Expand Down
8 changes: 4 additions & 4 deletions cmd/backup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"github.com/spf13/cobra"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/cmd/internal/survey"
nameSpcCmd "github.com/odpf/optimus/cmd/namespace"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/config"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/backup/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"github.com/spf13/cobra"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/backup/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"github.com/spf13/cobra"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/odpf/optimus/cmd/deploy"
"github.com/odpf/optimus/cmd/extension"
"github.com/odpf/optimus/cmd/initialize"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/job"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/namespace"
"github.com/odpf/optimus/cmd/plugin"
"github.com/odpf/optimus/cmd/project"
Expand Down
4 changes: 2 additions & 2 deletions cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (

v1handler "github.com/odpf/optimus/api/handler/v1beta1"
pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/namespace"
"github.com/odpf/optimus/cmd/plugin"
"github.com/odpf/optimus/cmd/project"
Expand Down
2 changes: 1 addition & 1 deletion cmd/extension/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/odpf/salt/log"
"github.com/spf13/cobra"

"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/extension"
)

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

"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/extension"
"github.com/odpf/optimus/extension/model"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/extension/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/odpf/salt/log"
"github.com/spf13/cobra"

"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/extension/model"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/initialize/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"

"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/utils"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/AlecAivazis/survey/v2"
"github.com/odpf/salt/log"

"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/logger"
)

// BackupCreateSurvey defines survey for creating backup
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions cmd/job/addhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/spf13/afero"
"github.com/spf13/cobra"

"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
"github.com/odpf/optimus/store/local"
Expand Down
4 changes: 2 additions & 2 deletions cmd/job/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/spf13/afero"
"github.com/spf13/cobra"

"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
"github.com/odpf/optimus/store/local"
Expand Down
4 changes: 2 additions & 2 deletions cmd/job/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/spf13/cobra"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/deploy"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/job/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/spf13/afero"
"github.com/spf13/cobra"

"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/compiler"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
Expand Down
4 changes: 2 additions & 2 deletions cmd/job/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

v1handler "github.com/odpf/optimus/api/handler/v1beta1"
pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
"github.com/odpf/optimus/store/local"
Expand Down
4 changes: 2 additions & 2 deletions cmd/job/run_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
"github.com/odpf/optimus/utils"
Expand Down
6 changes: 3 additions & 3 deletions cmd/job/run_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/config"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/job/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

v1handler "github.com/odpf/optimus/api/handler/v1beta1"
pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
"github.com/odpf/optimus/store/local"
Expand Down
4 changes: 2 additions & 2 deletions cmd/namespace/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/spf13/cobra"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
)

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

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/namespace/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"google.golang.org/grpc/status"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/plugin/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/odpf/salt/log"
"github.com/spf13/cobra"

"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/project/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"gopkg.in/yaml.v2"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/config"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/project/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"google.golang.org/grpc/status"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/namespace"
"github.com/odpf/optimus/config"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/replay/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"github.com/xlab/treeprint"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/cmd/namespace"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/core/set"
)
Expand Down
6 changes: 3 additions & 3 deletions cmd/replay/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/spf13/cobra"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
)
Expand Down
6 changes: 3 additions & 3 deletions cmd/replay/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/xlab/treeprint"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/resource/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/spf13/afero"
"github.com/spf13/cobra"

"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/config"
"github.com/odpf/optimus/models"
"github.com/odpf/optimus/store/local"
Expand Down
6 changes: 3 additions & 3 deletions cmd/secret/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"github.com/spf13/cobra"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/config"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/secret/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/spf13/cobra"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/config"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/secret/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"google.golang.org/grpc/status"

pb "github.com/odpf/optimus/api/proto/odpf/optimus/core/v1beta1"
"github.com/odpf/optimus/cmd/connectivity"
"github.com/odpf/optimus/cmd/internal"
"github.com/odpf/optimus/cmd/logger"
"github.com/odpf/optimus/cmd/progressbar"
"github.com/odpf/optimus/cmd/survey"
"github.com/odpf/optimus/cmd/internal/connectivity"
"github.com/odpf/optimus/cmd/internal/logger"
"github.com/odpf/optimus/cmd/internal/progressbar"
"github.com/odpf/optimus/cmd/internal/survey"
"github.com/odpf/optimus/config"
)

Expand Down
Loading

0 comments on commit a96503a

Please sign in to comment.