Moved connectors to their own package

This commit is contained in:
colin-mckibben-sp
2022-09-20 16:32:31 -04:00
parent 657995994f
commit c3d16aa7c0
52 changed files with 53 additions and 51 deletions

View File

@@ -5,14 +5,14 @@ import (
"bufio"
"context"
"fmt"
"github.com/sailpoint-oss/sp-cli/client"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"log"
"path/filepath"
"os"
"github.com/sailpoint-oss/sp-cli/client"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"os"
)
const (

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"encoding/json"
@@ -29,7 +29,7 @@ func connResourceUrl(endpoint string, resourceParts ...string) string {
return u.String()
}
func newConnCmd(client client.Client) *cobra.Command {
func NewConnCmd(client client.Client) *cobra.Command {
conn := &cobra.Command{
Use: "connectors",
Short: "Manage Connectors",

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"archive/zip"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"encoding/json"

View File

@@ -1,4 +1,4 @@
package cmd
package connector
import (
"bytes"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package cmd
package connector
import (
"bytes"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"encoding/json"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"encoding/json"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"encoding/json"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package cmd
package connector
import (
"encoding/json"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"encoding/json"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"time"

View File

@@ -1,4 +1,4 @@
package cmd
package connector
import (
"testing"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"testing"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"encoding/json"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"
@@ -32,7 +32,7 @@ func TestNewConnCmd_noArgs(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
cmd := newConnCmd(mocks.NewMockClient(ctrl))
cmd := NewConnCmd(mocks.NewMockClient(ctrl))
if len(cmd.Commands()) != numConnSubcommands {
t.Fatalf("expected: %d, actual: %d", len(cmd.Commands()), numConnSubcommands)
}

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package cmd
package connector
import (
"fmt"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2022, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"context"
@@ -19,6 +19,7 @@ import (
"github.com/logrusorgru/aurora"
"github.com/olekukonko/tablewriter"
"github.com/sailpoint-oss/sp-cli/client"
"github.com/sailpoint-oss/sp-cli/util"
"github.com/sailpoint-oss/sp-cli/validate"
"github.com/spf13/cobra"
"gopkg.in/alessio/shellescape.v1"
@@ -247,7 +248,7 @@ func runInstanceForValidation(source Source) (*exec.Cmd, string, error) {
log.Println("Npm install is finished")
err = ExecCommand("/bin/sh", "-c", fmt.Sprintf("npm run dev --prefix %s", path))
err = util.ExecCommand("/bin/sh", "-c", fmt.Sprintf("npm run dev --prefix %s", path))
if err != nil {
return nil, "", err
}

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"encoding/json"

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"bytes"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
package cmd
package connector
import (
"fmt"

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/sailpoint-oss/sp-cli/client"
"github.com/sailpoint-oss/sp-cli/cmd/connector"
"github.com/sailpoint-oss/sp-cli/cmd/transform"
"github.com/spf13/cobra"
)
@@ -24,8 +25,8 @@ func NewRootCmd(client client.Client) *cobra.Command {
},
}
root.AddCommand(
newConnCmd(client),
newConfigureCmd(client),
connector.NewConnCmd(client),
transform.NewTransformCmd(client),
)
return root

View File

@@ -3,7 +3,7 @@
//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd
// +build linux darwin dragonfly freebsd netbsd openbsd
package cmd
package util
import (
"os/exec"

View File

@@ -3,7 +3,7 @@
//go:build windows
// +build windows
package cmd
package util
import (
"os/exec"