Merge pull request #590 from docker/api_folder

This commit is contained in:
Nicolas De loof 2020-09-07 13:34:28 +02:00 committed by GitHub
commit 0dd6416742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 79 additions and 83 deletions

6
.github/labeler.yml vendored
View File

@ -8,11 +8,7 @@ cli:
- cli/**/*
api:
- containers/**/*
- compose/**/*
- secrets/**/*
- server/**/*
- protos/**/*
- api/**/*
ci:
- .github/**/*

View File

@ -35,7 +35,7 @@ import (
"github.com/docker/compose-cli/aci/convert"
"github.com/docker/compose-cli/aci/login"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/context/store"
"github.com/docker/compose-cli/errdefs"
"github.com/docker/compose-cli/progress"

View File

@ -33,14 +33,14 @@ import (
"github.com/docker/compose-cli/aci/convert"
"github.com/docker/compose-cli/aci/login"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/api/secrets"
"github.com/docker/compose-cli/backend"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/containers"
apicontext "github.com/docker/compose-cli/context"
"github.com/docker/compose-cli/context/cloud"
"github.com/docker/compose-cli/context/store"
"github.com/docker/compose-cli/errdefs"
"github.com/docker/compose-cli/secrets"
)
const (

View File

@ -23,7 +23,7 @@ import (
"github.com/stretchr/testify/mock"
"gotest.tools/v3/assert"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
)
func TestGetContainerName(t *testing.T) {

View File

@ -22,7 +22,7 @@ import (
"github.com/compose-spec/compose-go/types"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
)
// ContainerToComposeProject convert container config to compose project

View File

@ -23,7 +23,7 @@ import (
"github.com/compose-spec/compose-go/types"
"gotest.tools/v3/assert"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
)
func TestConvertContainerEnvironment(t *testing.T) {

View File

@ -26,7 +26,7 @@ import (
"strconv"
"strings"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/utils/formatter"
"github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance"
@ -35,7 +35,7 @@ import (
"github.com/pkg/errors"
"github.com/docker/compose-cli/aci/login"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/context/store"
)

View File

@ -21,7 +21,7 @@ import (
"os"
"testing"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/api/compose"
"github.com/Azure/azure-sdk-for-go/profiles/latest/containerinstance/mgmt/containerinstance"
"github.com/Azure/go-autorest/autorest/to"
@ -29,7 +29,7 @@ import (
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/context/store"
)

View File

@ -21,7 +21,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
)
// ToPorts converts Azure container ports to api ports

View File

@ -23,7 +23,7 @@ import (
"github.com/Azure/go-autorest/autorest/to"
"gotest.tools/v3/assert"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
)
func TestPortConvert(t *testing.T) {

View File

@ -19,13 +19,13 @@ package client
import (
"context"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/api/secrets"
"github.com/docker/compose-cli/backend"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/containers"
apicontext "github.com/docker/compose-cli/context"
"github.com/docker/compose-cli/context/cloud"
"github.com/docker/compose-cli/context/store"
"github.com/docker/compose-cli/secrets"
)
// New returns a backend client associated with current context

View File

@ -22,7 +22,7 @@ import (
"github.com/compose-spec/compose-go/types"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/errdefs"
)

View File

@ -19,7 +19,7 @@ package client
import (
"context"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/errdefs"
)

View File

@ -19,8 +19,8 @@ package client
import (
"context"
"github.com/docker/compose-cli/api/secrets"
"github.com/docker/compose-cli/errdefs"
"github.com/docker/compose-cli/secrets"
)
type secretsService struct {

View File

@ -23,11 +23,11 @@ import (
"github.com/sirupsen/logrus"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/api/secrets"
"github.com/docker/compose-cli/context/cloud"
"github.com/docker/compose-cli/errdefs"
"github.com/docker/compose-cli/secrets"
)
var (

View File

@ -23,7 +23,7 @@ import (
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/errdefs"
)

View File

@ -23,7 +23,7 @@ import (
"github.com/compose-spec/compose-go/cli"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
)
func convertCommand() *cobra.Command {

View File

@ -21,7 +21,7 @@ import (
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/progress"
)

View File

@ -24,7 +24,7 @@ import (
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
)
func listCommand() *cobra.Command {

View File

@ -22,7 +22,7 @@ import (
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
)
func logsCommand() *cobra.Command {

View File

@ -26,7 +26,7 @@ import (
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
)
func psCommand() *cobra.Command {

View File

@ -23,7 +23,7 @@ import (
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/progress"
)

View File

@ -23,7 +23,7 @@ import (
"github.com/spf13/cobra"
"github.com/docker/compose-cli/aci"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/context/store"
"github.com/docker/compose-cli/errdefs"
)

View File

@ -22,7 +22,7 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/context/store"
"github.com/docker/compose-cli/ecs"
"github.com/docker/compose-cli/errdefs"

View File

@ -26,8 +26,8 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/api/containers"
)
type execOpts struct {

View File

@ -23,7 +23,7 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/formatter"
)

View File

@ -25,7 +25,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/errdefs"
)

View File

@ -26,8 +26,8 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/cli/mobycli"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/errdefs"
)

View File

@ -23,7 +23,7 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/errdefs"
)

View File

@ -25,8 +25,8 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/api/containers"
)
type logsOpts struct {

View File

@ -28,7 +28,7 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
formatter2 "github.com/docker/compose-cli/formatter"
)

View File

@ -25,8 +25,8 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/errdefs"
)

View File

@ -25,10 +25,10 @@ import (
"github.com/containerd/console"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/cli/options/run"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/progress"
)

View File

@ -25,8 +25,8 @@ import (
"github.com/spf13/cobra"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/secrets"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/api/secrets"
)
type createSecretOptions struct {

View File

@ -22,7 +22,7 @@ import (
"gotest.tools/v3/golden"
"github.com/docker/compose-cli/secrets"
"github.com/docker/compose-cli/api/secrets"
)
func TestPrintList(t *testing.T) {

View File

@ -27,7 +27,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
)
// StartCommand starts containers

View File

@ -27,7 +27,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
)
type stopOpts struct {

View File

@ -26,7 +26,7 @@ import (
"github.com/docker/docker/pkg/namesgenerator"
"github.com/docker/go-connections/nat"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/formatter"
)

View File

@ -25,7 +25,7 @@ import (
"gotest.tools/v3/assert"
"gotest.tools/v3/assert/cmp"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
)
var (

View File

@ -22,14 +22,14 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/api/secrets"
"github.com/docker/compose-cli/backend"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/containers"
apicontext "github.com/docker/compose-cli/context"
"github.com/docker/compose-cli/context/cloud"
"github.com/docker/compose-cli/context/store"
"github.com/docker/compose-cli/errdefs"
"github.com/docker/compose-cli/secrets"
)
const backendType = store.EcsContextType

View File

@ -23,7 +23,7 @@ import (
"regexp"
"strings"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/api/compose"
ecsapi "github.com/aws/aws-sdk-go/service/ecs"
"github.com/aws/aws-sdk-go/service/elbv2"

View File

@ -21,7 +21,7 @@ import (
"reflect"
"testing"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/api/compose"
"github.com/aws/aws-sdk-go/service/elbv2"
"github.com/awslabs/goformation/v4/cloudformation"

View File

@ -19,7 +19,7 @@ package ecs
import (
"context"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/api/compose"
)
func (b *ecsAPIService) List(ctx context.Context, project string) ([]compose.Stack, error) {

View File

@ -19,9 +19,9 @@ package local
import (
"context"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/secrets"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/api/secrets"
"github.com/docker/docker/client"
"github.com/docker/compose-cli/backend"

View File

@ -30,7 +30,7 @@ import (
types2 "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/errdefs"
"github.com/aws/aws-sdk-go/aws"

View File

@ -21,7 +21,7 @@ import (
"fmt"
"strings"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/api/compose"
)
func (b *ecsAPIService) Ps(ctx context.Context, project string) ([]compose.ServiceStatus, error) {

View File

@ -24,8 +24,8 @@ import (
"github.com/aws/aws-sdk-go/aws/client"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/secrets"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/api/secrets"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudformation"

View File

@ -19,7 +19,7 @@ package ecs
import (
"context"
"github.com/docker/compose-cli/secrets"
"github.com/docker/compose-cli/api/secrets"
)
func (b *ecsAPIService) CreateSecret(ctx context.Context, secret secrets.Secret) (string, error) {

View File

@ -26,12 +26,12 @@ import (
"github.com/compose-spec/compose-go/types"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/api/secrets"
"github.com/docker/compose-cli/backend"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/context/cloud"
"github.com/docker/compose-cli/errdefs"
"github.com/docker/compose-cli/secrets"
)
type apiService struct {

View File

@ -36,12 +36,12 @@ import (
"github.com/docker/docker/pkg/stdcopy"
"github.com/pkg/errors"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/api/secrets"
"github.com/docker/compose-cli/backend"
"github.com/docker/compose-cli/compose"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/context/cloud"
"github.com/docker/compose-cli/errdefs"
"github.com/docker/compose-cli/secrets"
)
type local struct {

View File

@ -24,7 +24,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/config"
apicontext "github.com/docker/compose-cli/context"
"github.com/docker/compose-cli/context/store"

View File

@ -20,7 +20,7 @@ import (
"context"
"errors"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/formatter"
containersv1 "github.com/docker/compose-cli/protos/containers/v1"
"github.com/docker/compose-cli/server/proxy/streams"

View File

@ -21,7 +21,7 @@ import (
"gotest.tools/v3/assert"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/formatter"
containersv1 "github.com/docker/compose-cli/protos/containers/v1"
)

View File

@ -20,7 +20,7 @@ import (
"context"
"sync"
"github.com/docker/compose-cli/client"
"github.com/docker/compose-cli/api/client"
"github.com/docker/compose-cli/config"
containersv1 "github.com/docker/compose-cli/protos/containers/v1"
contextsv1 "github.com/docker/compose-cli/protos/contexts/v1"

View File

@ -45,7 +45,7 @@ import (
"github.com/docker/compose-cli/aci"
"github.com/docker/compose-cli/aci/login"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
"github.com/docker/compose-cli/context/store"
"github.com/docker/compose-cli/errdefs"
"github.com/docker/compose-cli/tests/aci-e2e/storage"

View File

@ -33,7 +33,7 @@ import (
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/icmd"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
)
var (

View File

@ -22,7 +22,7 @@ import (
"strconv"
"strings"
"github.com/docker/compose-cli/containers"
"github.com/docker/compose-cli/api/containers"
)
type portGroup struct {