Bläddra i källkod

Move filters package to the API.

These filters are only use to interchange data between clients and daemons.
They don't belong to the parsers package.

Signed-off-by: David Calavera <david.calavera@gmail.com>
David Calavera 9 år sedan
förälder
incheckning
e98cae4919

+ 1 - 1
api/client/client.go

@@ -9,8 +9,8 @@ import (
 
 	"github.com/docker/docker/api/client/lib"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/registry"
-	"github.com/docker/docker/pkg/parsers/filters"
 	"github.com/docker/docker/runconfig"
 )
 

+ 1 - 1
api/client/events.go

@@ -2,11 +2,11 @@ package client
 
 import (
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	Cli "github.com/docker/docker/cli"
 	"github.com/docker/docker/opts"
 	"github.com/docker/docker/pkg/jsonmessage"
 	flag "github.com/docker/docker/pkg/mflag"
-	"github.com/docker/docker/pkg/parsers/filters"
 )
 
 // CmdEvents prints a live stream of real time events from the server.

+ 1 - 1
api/client/images.go

@@ -8,10 +8,10 @@ import (
 
 	"github.com/docker/distribution/reference"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	Cli "github.com/docker/docker/cli"
 	"github.com/docker/docker/opts"
 	flag "github.com/docker/docker/pkg/mflag"
-	"github.com/docker/docker/pkg/parsers/filters"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/pkg/units"
 )

+ 1 - 1
api/client/lib/container_list.go

@@ -6,7 +6,7 @@ import (
 	"strconv"
 
 	"github.com/docker/docker/api/types"
-	"github.com/docker/docker/pkg/parsers/filters"
+	"github.com/docker/docker/api/types/filters"
 )
 
 // ContainerList returns the list of containers in the docker host.

+ 1 - 1
api/client/lib/events.go

@@ -6,8 +6,8 @@ import (
 	"time"
 
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	timetypes "github.com/docker/docker/api/types/time"
-	"github.com/docker/docker/pkg/parsers/filters"
 )
 
 // Events returns a stream of events in the daemon in a ReadCloser.

+ 1 - 1
api/client/lib/image_list.go

@@ -5,7 +5,7 @@ import (
 	"net/url"
 
 	"github.com/docker/docker/api/types"
-	"github.com/docker/docker/pkg/parsers/filters"
+	"github.com/docker/docker/api/types/filters"
 )
 
 // ImageList returns a list of images in the docker host.

+ 1 - 1
api/client/lib/volume.go

@@ -6,7 +6,7 @@ import (
 	"net/url"
 
 	"github.com/docker/docker/api/types"
-	"github.com/docker/docker/pkg/parsers/filters"
+	"github.com/docker/docker/api/types/filters"
 )
 
 // VolumeList returns the volumes configured in the docker host.

+ 1 - 1
api/client/ps.go

@@ -3,10 +3,10 @@ package client
 import (
 	"github.com/docker/docker/api/client/ps"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	Cli "github.com/docker/docker/cli"
 	"github.com/docker/docker/opts"
 	flag "github.com/docker/docker/pkg/mflag"
-	"github.com/docker/docker/pkg/parsers/filters"
 )
 
 // CmdPs outputs a list of Docker containers.

+ 1 - 1
api/client/volume.go

@@ -5,10 +5,10 @@ import (
 	"text/tabwriter"
 
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	Cli "github.com/docker/docker/cli"
 	"github.com/docker/docker/opts"
 	flag "github.com/docker/docker/pkg/mflag"
-	"github.com/docker/docker/pkg/parsers/filters"
 )
 
 // CmdVolume is the parent subcommand for all volume commands

+ 2 - 1
api/common_test.go

@@ -5,8 +5,9 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/docker/docker/api/types"
 	"os"
+
+	"github.com/docker/docker/api/types"
 )
 
 type ports struct {

+ 1 - 1
api/server/router/network/network_routes.go

@@ -10,9 +10,9 @@ import (
 	"github.com/Sirupsen/logrus"
 	"github.com/docker/docker/api/server/httputils"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/daemon"
-	"github.com/docker/docker/pkg/parsers/filters"
 	"github.com/docker/docker/runconfig"
 	"github.com/docker/libnetwork"
 )

+ 1 - 1
api/server/router/system/backend.go

@@ -2,8 +2,8 @@ package system
 
 import (
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/pkg/jsonmessage"
-	"github.com/docker/docker/pkg/parsers/filters"
 )
 
 // Backend is the methods that need to be implemented to provide

+ 1 - 1
api/server/router/system/system_routes.go

@@ -9,10 +9,10 @@ import (
 	"github.com/docker/docker/api"
 	"github.com/docker/docker/api/server/httputils"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	timetypes "github.com/docker/docker/api/types/time"
 	"github.com/docker/docker/pkg/ioutils"
 	"github.com/docker/docker/pkg/jsonmessage"
-	"github.com/docker/docker/pkg/parsers/filters"
 	"golang.org/x/net/context"
 )
 

+ 1 - 1
api/types/client.go

@@ -5,7 +5,7 @@ import (
 	"io"
 	"net"
 
-	"github.com/docker/docker/pkg/parsers/filters"
+	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/pkg/ulimit"
 	"github.com/docker/docker/runconfig"
 )

+ 0 - 0
pkg/parsers/filters/parse.go → api/types/filters/parse.go


+ 0 - 0
pkg/parsers/filters/parse_test.go → api/types/filters/parse_test.go


+ 1 - 1
daemon/daemon.go

@@ -22,6 +22,7 @@ import (
 	"github.com/docker/distribution/reference"
 	"github.com/docker/docker/api"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	registrytypes "github.com/docker/docker/api/types/registry"
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/daemon/events"
@@ -49,7 +50,6 @@ import (
 	"github.com/docker/docker/pkg/mount"
 	"github.com/docker/docker/pkg/namesgenerator"
 	"github.com/docker/docker/pkg/nat"
-	"github.com/docker/docker/pkg/parsers/filters"
 	"github.com/docker/docker/pkg/progress"
 	"github.com/docker/docker/pkg/signal"
 	"github.com/docker/docker/pkg/streamformatter"

+ 1 - 1
daemon/events/filter.go

@@ -2,8 +2,8 @@ package events
 
 import (
 	"github.com/docker/distribution/reference"
+	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/pkg/jsonmessage"
-	"github.com/docker/docker/pkg/parsers/filters"
 )
 
 // Filter can filter out docker events from a stream

+ 2 - 2
daemon/images.go

@@ -7,9 +7,9 @@ import (
 
 	"github.com/docker/distribution/reference"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/image"
 	"github.com/docker/docker/layer"
-	"github.com/docker/docker/pkg/parsers/filters"
 )
 
 var acceptedImageFilterTags = map[string]bool{
@@ -31,7 +31,7 @@ func (daemon *Daemon) Map() map[image.ID]*image.Image {
 }
 
 // Images returns a filtered list of images. filterArgs is a JSON-encoded set
-// of filter arguments which will be interpreted by pkg/parsers/filters.
+// of filter arguments which will be interpreted by api/types/filters.
 // filter is a shell glob string applied to repository names. The argument
 // named all controls whether all images in the graph are filtered, or just
 // the heads.

+ 1 - 1
daemon/list.go

@@ -8,11 +8,11 @@ import (
 
 	"github.com/Sirupsen/logrus"
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/image"
 	"github.com/docker/docker/pkg/graphdb"
 	"github.com/docker/docker/pkg/nat"
-	"github.com/docker/docker/pkg/parsers/filters"
 )
 
 // iterationAction represents possible outcomes happening during the container iteration.

+ 1 - 1
integration-cli/docker_api_network_test.go

@@ -9,9 +9,9 @@ import (
 	"strings"
 
 	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/pkg/integration/checker"
-	"github.com/docker/docker/pkg/parsers/filters"
 	"github.com/go-check/check"
 )