Restructure steampipe repo to use pkg folder. Closes #2204

This commit is contained in:
kaidaguerre
2022-06-27 11:36:03 +01:00
committed by GitHub
parent fb9c36b652
commit 5193c70395
791 changed files with 707 additions and 663 deletions

1
bk/.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
**/*.sp linguist-language=HCL

34
bk/.gitignore vendored Normal file
View File

@@ -0,0 +1,34 @@
# Editor cache and lock files
*.swp
*.swo
.idea/
.vscode/
.DS_Store
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
# Dashboard UI
/ui/dashboard/.idea
/ui/dashboard/.vscode
/ui/dashboard/build
/ui/dashboard/node_modules
/ui/dashboard/output
/ui/dashboard/yarn-debug.log*
/ui/dashboard/yarn-error.log*
# Dist directory is created by goreleaser
/dist

9
bk/.gitmodules vendored Normal file
View File

@@ -0,0 +1,9 @@
[submodule "tests/acceptance/lib/bats"]
path = tests/acceptance/lib/bats
url = https://github.com/sstephenson/bats
[submodule "tests/acceptance/lib/bats-assert"]
path = tests/acceptance/lib/bats-assert
url = https://github.com/ztombol/bats-assert
[submodule "tests/acceptance/lib/bats-support"]
path = tests/acceptance/lib/bats-support
url = https://github.com/ztombol/bats-support

View File

@@ -16,17 +16,17 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/contexthelpers"
"github.com/turbot/steampipe/control"
"github.com/turbot/steampipe/control/controldisplay"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/control/controlstatus"
"github.com/turbot/steampipe/display"
"github.com/turbot/steampipe/statushooks"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/workspace"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/contexthelpers"
"github.com/turbot/steampipe/pkg/control"
"github.com/turbot/steampipe/pkg/control/controldisplay"
"github.com/turbot/steampipe/pkg/control/controlexecute"
"github.com/turbot/steampipe/pkg/control/controlstatus"
"github.com/turbot/steampipe/pkg/display"
"github.com/turbot/steampipe/pkg/statushooks"
"github.com/turbot/steampipe/pkg/utils"
"github.com/turbot/steampipe/pkg/workspace"
)
func checkCmd() *cobra.Command {

View File

@@ -6,8 +6,8 @@ import (
"runtime"
"github.com/spf13/cobra"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
)
func generateCompletionScriptsCmd() *cobra.Command {

View File

@@ -6,20 +6,20 @@ import (
"log"
"os"
"github.com/turbot/steampipe/statushooks"
"github.com/turbot/steampipe/workspace"
"github.com/turbot/steampipe/pkg/statushooks"
"github.com/turbot/steampipe/pkg/workspace"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe-plugin-sdk/v3/logging"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/contexthelpers"
"github.com/turbot/steampipe/dashboard"
"github.com/turbot/steampipe/dashboard/dashboardassets"
"github.com/turbot/steampipe/dashboard/dashboardserver"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/contexthelpers"
"github.com/turbot/steampipe/pkg/dashboard"
"github.com/turbot/steampipe/pkg/dashboard/dashboardassets"
"github.com/turbot/steampipe/pkg/dashboard/dashboardserver"
"github.com/turbot/steampipe/pkg/utils"
)
func dashboardCmd() *cobra.Command {

View File

@@ -7,13 +7,13 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/filepaths"
"github.com/turbot/steampipe/modinstaller"
"github.com/turbot/steampipe/steampipeconfig/modconfig"
"github.com/turbot/steampipe/steampipeconfig/parse"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/filepaths"
"github.com/turbot/steampipe/pkg/modinstaller"
"github.com/turbot/steampipe/pkg/steampipeconfig/modconfig"
"github.com/turbot/steampipe/pkg/steampipeconfig/parse"
"github.com/turbot/steampipe/pkg/utils"
)
// mod management commands

View File

@@ -12,18 +12,18 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/db/db_local"
"github.com/turbot/steampipe/display"
"github.com/turbot/steampipe/ociinstaller"
"github.com/turbot/steampipe/ociinstaller/versionfile"
"github.com/turbot/steampipe/plugin"
"github.com/turbot/steampipe/statefile"
"github.com/turbot/steampipe/statushooks"
"github.com/turbot/steampipe/steampipeconfig"
"github.com/turbot/steampipe/steampipeconfig/modconfig"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/db/db_local"
"github.com/turbot/steampipe/pkg/display"
"github.com/turbot/steampipe/pkg/ociinstaller"
"github.com/turbot/steampipe/pkg/ociinstaller/versionfile"
"github.com/turbot/steampipe/pkg/plugin"
"github.com/turbot/steampipe/pkg/statefile"
"github.com/turbot/steampipe/pkg/statushooks"
"github.com/turbot/steampipe/pkg/steampipeconfig"
"github.com/turbot/steampipe/pkg/steampipeconfig/modconfig"
"github.com/turbot/steampipe/pkg/utils"
)
// Plugin management commands

View File

@@ -13,13 +13,13 @@ import (
"github.com/hashicorp/go-hclog"
"github.com/spf13/cobra"
"github.com/turbot/steampipe-plugin-sdk/v3/logging"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/connectionwatcher"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/filepaths"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/connectionwatcher"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/filepaths"
"github.com/turbot/steampipe/pkg/steampipeconfig"
"github.com/turbot/steampipe/pkg/utils"
"github.com/turbot/steampipe/pluginmanager"
"github.com/turbot/steampipe/steampipeconfig"
"github.com/turbot/steampipe/utils"
)
func pluginManagerCmd() *cobra.Command {

View File

@@ -11,15 +11,15 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/interactive"
"github.com/turbot/steampipe/query"
"github.com/turbot/steampipe/query/queryexecute"
"github.com/turbot/steampipe/statushooks"
"github.com/turbot/steampipe/steampipeconfig/modconfig"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/workspace"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/interactive"
"github.com/turbot/steampipe/pkg/query"
"github.com/turbot/steampipe/pkg/query/queryexecute"
"github.com/turbot/steampipe/pkg/statushooks"
"github.com/turbot/steampipe/pkg/steampipeconfig/modconfig"
"github.com/turbot/steampipe/pkg/utils"
"github.com/turbot/steampipe/pkg/workspace"
)
func queryCmd() *cobra.Command {

View File

@@ -14,17 +14,17 @@ import (
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe-plugin-sdk/v3/logging"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/filepaths"
"github.com/turbot/steampipe/migrate"
"github.com/turbot/steampipe/ociinstaller/versionfile"
"github.com/turbot/steampipe/statefile"
"github.com/turbot/steampipe/statushooks"
"github.com/turbot/steampipe/steampipeconfig"
"github.com/turbot/steampipe/task"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/version"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/filepaths"
"github.com/turbot/steampipe/pkg/migrate"
"github.com/turbot/steampipe/pkg/ociinstaller/versionfile"
"github.com/turbot/steampipe/pkg/statefile"
"github.com/turbot/steampipe/pkg/statushooks"
"github.com/turbot/steampipe/pkg/steampipeconfig"
"github.com/turbot/steampipe/pkg/task"
"github.com/turbot/steampipe/pkg/utils"
"github.com/turbot/steampipe/pkg/version"
)
var exitCode int

View File

@@ -5,8 +5,8 @@ import (
"errors"
"fmt"
"github.com/turbot/steampipe/dashboard/dashboardserver"
"github.com/turbot/steampipe/statushooks"
"github.com/turbot/steampipe/pkg/dashboard/dashboardserver"
"github.com/turbot/steampipe/pkg/statushooks"
"os"
"os/signal"
@@ -17,12 +17,12 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/db/db_local"
"github.com/turbot/steampipe/display"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/db/db_local"
"github.com/turbot/steampipe/pkg/display"
"github.com/turbot/steampipe/pkg/utils"
"github.com/turbot/steampipe/pluginmanager"
"github.com/turbot/steampipe/utils"
)
func serviceCmd() *cobra.Command {

View File

@@ -6,11 +6,11 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/display"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/workspace"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/display"
"github.com/turbot/steampipe/pkg/utils"
"github.com/turbot/steampipe/pkg/workspace"
)
// Variable management commands

View File

@@ -11,8 +11,8 @@ import (
filehelpers "github.com/turbot/go-kit/files"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/cmd"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/utils"
)
var exitCode int

View File

@@ -7,10 +7,10 @@ import (
"net/http"
"strings"
"github.com/turbot/steampipe/steampipeconfig"
"github.com/turbot/steampipe/pkg/steampipeconfig"
"github.com/spf13/viper"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/pkg/constants"
)
const actorAPI = "/api/v1/actor"

View File

@@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/pkg/utils"
)
type CmdBuilder struct {

View File

@@ -5,9 +5,9 @@ import (
"strings"
"github.com/spf13/viper"
"github.com/turbot/steampipe/cloud"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/steampipeconfig"
"github.com/turbot/steampipe/pkg/cloud"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/steampipeconfig"
)
func GetCloudMetadata() (*steampipeconfig.CloudMetadata, error) {

View File

@@ -6,8 +6,8 @@ import (
"github.com/spf13/viper"
"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/filepaths"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/filepaths"
)
// Viper fetches the global viper instance

View File

@@ -1,8 +1,8 @@
package connectionwatcher
import (
"github.com/turbot/steampipe/pkg/steampipeconfig/modconfig"
pb "github.com/turbot/steampipe/pluginmanager/grpc/proto"
"github.com/turbot/steampipe/steampipeconfig/modconfig"
)
func NewConnectionConfigMap(connectionMap map[string]*modconfig.Connection) map[string]*pb.ConnectionConfig {

View File

@@ -7,13 +7,13 @@ import (
"github.com/fsnotify/fsnotify"
filehelpers "github.com/turbot/go-kit/files"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/cmdconfig"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/db/db_local"
"github.com/turbot/steampipe/filepaths"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/db/db_local"
"github.com/turbot/steampipe/pkg/filepaths"
"github.com/turbot/steampipe/pkg/steampipeconfig"
"github.com/turbot/steampipe/pkg/utils"
pb "github.com/turbot/steampipe/pluginmanager/grpc/proto"
"github.com/turbot/steampipe/steampipeconfig"
"github.com/turbot/steampipe/utils"
)
type ConnectionWatcher struct {

View File

@@ -3,7 +3,7 @@ package constants
import (
"fmt"
"github.com/turbot/steampipe/version"
"github.com/turbot/steampipe/pkg/version"
)
const (

View File

@@ -3,7 +3,7 @@ package constants
import (
"fmt"
"github.com/turbot/steampipe/schema"
"github.com/turbot/steampipe/pkg/schema"
)
// dbClient constants

View File

@@ -4,8 +4,8 @@ import (
"fmt"
"time"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/utils"
)
var (

View File

@@ -5,8 +5,8 @@ import (
"reflect"
"github.com/logrusorgru/aurora"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/utils"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/utils"
)
type colorFunc func(interface{}) aurora.Value

View File

@@ -6,8 +6,8 @@ import (
"github.com/spf13/viper"
typehelpers "github.com/turbot/go-kit/types"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
type ControlRenderer struct {

View File

@@ -3,7 +3,7 @@ package controldisplay
import (
"github.com/turbot/go-kit/helpers"
typehelpers "github.com/turbot/go-kit/types"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
type CSVRenderer struct {

View File

@@ -7,7 +7,7 @@ import (
"github.com/logrusorgru/aurora"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
type DimensionsRenderer struct {

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/pkg/constants"
)
type ErrorRenderer struct {

View File

@@ -6,7 +6,7 @@ import (
"path/filepath"
"strings"
"github.com/turbot/steampipe/filepaths"
"github.com/turbot/steampipe/pkg/filepaths"
)
type ExportTemplate struct {

View File

@@ -6,8 +6,8 @@ import (
"io"
"strings"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
var ErrFormatterNotFound = errors.New("Formatter not found")

View File

@@ -9,7 +9,7 @@ import (
"os"
"path/filepath"
"github.com/turbot/steampipe/filepaths"
"github.com/turbot/steampipe/pkg/filepaths"
)
//go:embed templates/*

View File

@@ -8,9 +8,9 @@ import (
"text/template"
"github.com/spf13/viper"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/version"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/control/controlexecute"
"github.com/turbot/steampipe/pkg/version"
)
type TemplateRenderConfig struct {

View File

@@ -7,7 +7,7 @@ import (
"testing"
"github.com/otiai10/copy"
"github.com/turbot/steampipe/filepaths"
"github.com/turbot/steampipe/pkg/filepaths"
)
type Testcase struct {

View File

@@ -9,9 +9,9 @@ package controldisplay
// jsonpatch "github.com/evanphx/json-patch"
// "github.com/spf13/viper"
// "github.com/turbot/steampipe/constants"
// "github.com/turbot/steampipe/control/controlexecute"
// "github.com/turbot/steampipe/steampipeconfig/modconfig"
// "github.com/turbot/steampipe/pkg/constants"
// "github.com/turbot/steampipe/pkg/control/controlexecute"
// "github.com/turbot/steampipe/pkg/steampipeconfig/modconfig"
// )
// var rootBenchmark = modconfig.Benchmark{}

View File

@@ -8,8 +8,8 @@ import (
"github.com/karrick/gows"
"github.com/spf13/viper"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
const MaxColumns = 200

View File

@@ -5,8 +5,8 @@ import (
"log"
"strings"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/steampipeconfig/modconfig"
"github.com/turbot/steampipe/pkg/control/controlexecute"
"github.com/turbot/steampipe/pkg/steampipeconfig/modconfig"
)
type GroupRenderer struct {

View File

@@ -6,7 +6,7 @@ import (
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/pkg/constants"
)
type GroupHeadingRenderer struct {

View File

@@ -5,8 +5,8 @@ import (
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
const minReasonWidth = 10

View File

@@ -7,7 +7,7 @@ import (
"sort"
"strings"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
type CsvColumnPair struct {

View File

@@ -5,7 +5,7 @@ import (
"strings"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
type SummaryRenderer struct {

View File

@@ -2,7 +2,7 @@ package controldisplay
import (
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
type SummarySeverityRenderer struct {

View File

@@ -5,7 +5,7 @@ import (
"strings"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
type SummarySeverityRowRenderer struct {

View File

@@ -5,8 +5,8 @@ import (
"strings"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/control/controlexecute"
"golang.org/x/text/language"
"golang.org/x/text/message"
)

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
type SummaryTotalRowRenderer struct {

View File

@@ -4,8 +4,8 @@ import (
"strings"
"github.com/spf13/viper"
"github.com/turbot/steampipe/constants"
"github.com/turbot/steampipe/control/controlexecute"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/control/controlexecute"
)
type TableRenderer struct {

Some files were not shown because too many files have changed in this diff Show More