flatten package structure

This commit is contained in:
Luke K 2020-05-06 07:48:11 +00:00
parent 208fba4f40
commit 1a3fbe294d
No known key found for this signature in database
GPG Key ID: 4896F75BAF2E1966
18 changed files with 30 additions and 31 deletions

View File

@ -1,4 +1,4 @@
package client
package faas
import (
"errors"

View File

@ -1,4 +1,4 @@
package client_test
package faas_test
import (
"fmt"
@ -6,8 +6,7 @@ import (
"path/filepath"
"testing"
"github.com/boson-project/faas/client"
"github.com/boson-project/faas/client/mock"
"github.com/boson-project/faas/mock"
)
// TestNew ensures that instantiation succeeds or fails as expected.

View File

@ -1,4 +1,4 @@
package client
package faas
import (
"io/ioutil"

View File

@ -6,8 +6,8 @@ import (
"github.com/ory/viper"
"github.com/spf13/cobra"
"github.com/boson-project/faas"
"github.com/boson-project/faas/appsody"
"github.com/boson-project/faas/client"
"github.com/boson-project/faas/docker"
"github.com/boson-project/faas/kubectl"
)
@ -85,14 +85,14 @@ func create(cmd *cobra.Command, args []string) (err error) {
// Instantiate a client, specifying concrete implementations for
// Initializer and Deployer, as well as setting the optional verbosity param.
client, err := client.New(
client, err := faas.New(
".",
client.WithVerbose(verbose),
client.WithName(name),
client.WithInitializer(initializer),
client.WithBuilder(builder),
client.WithPusher(pusher),
client.WithDeployer(deployer),
faas.WithVerbose(verbose),
faas.WithName(name),
faas.WithInitializer(initializer),
faas.WithBuilder(builder),
faas.WithPusher(pusher),
faas.WithDeployer(deployer),
)
if err != nil {
return

View File

@ -1,7 +1,7 @@
package cmd
import (
"github.com/boson-project/faas/client"
"github.com/boson-project/faas"
"github.com/boson-project/faas/kubectl"
"github.com/ory/viper"
"github.com/spf13/cobra"
@ -29,9 +29,9 @@ func delete(cmd *cobra.Command, args []string) (err error) {
remover = kubectl.NewRemover()
)
client, err := client.New(".",
client.WithVerbose(verbose),
client.WithRemover(remover),
client, err := faas.New(".",
faas.WithVerbose(verbose),
faas.WithRemover(remover),
)
if err != nil {
return

View File

@ -3,7 +3,7 @@ package cmd
import (
"fmt"
"github.com/boson-project/faas/client"
"github.com/boson-project/faas"
"github.com/boson-project/faas/knative"
"github.com/ory/viper"
"github.com/spf13/cobra"
@ -32,9 +32,9 @@ func list(cmd *cobra.Command, args []string) (err error) {
}
lister.Verbose = verbose
client, err := client.New(".",
client.WithVerbose(verbose),
client.WithLister(lister),
client, err := faas.New(".",
faas.WithVerbose(verbose),
faas.WithLister(lister),
)
if err != nil {
return

View File

@ -4,8 +4,8 @@ import (
"github.com/ory/viper"
"github.com/spf13/cobra"
"github.com/boson-project/faas"
"github.com/boson-project/faas/appsody"
"github.com/boson-project/faas/client"
)
func init() {
@ -26,9 +26,9 @@ func run(cmd *cobra.Command, args []string) (err error) {
runner := appsody.NewRunner()
runner.Verbose = verbose
client, err := client.New(".",
client.WithRunner(runner),
client.WithVerbose(verbose))
client, err := faas.New(".",
faas.WithRunner(runner),
faas.WithVerbose(verbose))
if err != nil {
return
}

View File

@ -6,8 +6,8 @@ import (
"github.com/ory/viper"
"github.com/spf13/cobra"
"github.com/boson-project/faas"
"github.com/boson-project/faas/appsody"
"github.com/boson-project/faas/client"
"github.com/boson-project/faas/docker"
"github.com/boson-project/faas/kn"
)
@ -48,11 +48,11 @@ func update(cmd *cobra.Command, args []string) (err error) {
updater := kn.NewUpdater()
updater.Verbose = verbose
client, err := client.New(".",
client.WithVerbose(verbose),
client.WithBuilder(builder),
client.WithPusher(pusher),
client.WithUpdater(updater),
client, err := faas.New(".",
faas.WithVerbose(verbose),
faas.WithBuilder(builder),
faas.WithPusher(pusher),
faas.WithUpdater(updater),
)
if err != nil {
return