Browse code

Move blkiodev package to types.

Signed-off-by: David Calavera <david.calavera@gmail.com>

David Calavera authored on 2015/12/19 02:44:39
Showing 7 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,23 @@
0
+package blkiodev
1
+
2
+import "fmt"
3
+
4
+// WeightDevice is a structure that hold device:weight pair
5
+type WeightDevice struct {
6
+	Path   string
7
+	Weight uint16
8
+}
9
+
10
+func (w *WeightDevice) String() string {
11
+	return fmt.Sprintf("%s:%d", w.Path, w.Weight)
12
+}
13
+
14
+// ThrottleDevice is a structure that hold device:rate_per_second pair
15
+type ThrottleDevice struct {
16
+	Path string
17
+	Rate uint64
18
+}
19
+
20
+func (t *ThrottleDevice) String() string {
21
+	return fmt.Sprintf("%s:%d", t.Path, t.Rate)
22
+}
0 23
old mode 100755
1 24
new mode 100644
... ...
@@ -12,12 +12,12 @@ import (
12 12
 	"syscall"
13 13
 
14 14
 	"github.com/Sirupsen/logrus"
15
+	pblkiodev "github.com/docker/docker/api/types/blkiodev"
15 16
 	"github.com/docker/docker/container"
16 17
 	"github.com/docker/docker/daemon/graphdriver"
17 18
 	derr "github.com/docker/docker/errors"
18 19
 	"github.com/docker/docker/image"
19 20
 	"github.com/docker/docker/layer"
20
-	pblkiodev "github.com/docker/docker/pkg/blkiodev"
21 21
 	"github.com/docker/docker/pkg/idtools"
22 22
 	"github.com/docker/docker/pkg/parsers/kernel"
23 23
 	"github.com/docker/docker/pkg/sysinfo"
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"strconv"
9 9
 	"strings"
10 10
 
11
-	"github.com/docker/docker/pkg/blkiodev"
11
+	"github.com/docker/docker/api/types/blkiodev"
12 12
 	"github.com/docker/go-units"
13 13
 )
14 14
 
... ...
@@ -3,7 +3,7 @@ package opts
3 3
 import (
4 4
 	"fmt"
5 5
 
6
-	"github.com/docker/docker/pkg/blkiodev"
6
+	"github.com/docker/docker/api/types/blkiodev"
7 7
 )
8 8
 
9 9
 // ThrottledeviceOpt defines a map of ThrottleDevices
... ...
@@ -3,7 +3,7 @@ package opts
3 3
 import (
4 4
 	"fmt"
5 5
 
6
-	"github.com/docker/docker/pkg/blkiodev"
6
+	"github.com/docker/docker/api/types/blkiodev"
7 7
 )
8 8
 
9 9
 // WeightdeviceOpt defines a map of WeightDevices
10 10
deleted file mode 100644
... ...
@@ -1,25 +0,0 @@
1
-package blkiodev
2
-
3
-import (
4
-	"fmt"
5
-)
6
-
7
-// WeightDevice is a structure that hold device:weight pair
8
-type WeightDevice struct {
9
-	Path   string
10
-	Weight uint16
11
-}
12
-
13
-func (w *WeightDevice) String() string {
14
-	return fmt.Sprintf("%s:%d", w.Path, w.Weight)
15
-}
16
-
17
-// ThrottleDevice is a structure that hold device:rate_per_second pair
18
-type ThrottleDevice struct {
19
-	Path string
20
-	Rate uint64
21
-}
22
-
23
-func (t *ThrottleDevice) String() string {
24
-	return fmt.Sprintf("%s:%d", t.Path, t.Rate)
25
-}
... ...
@@ -5,8 +5,8 @@ import (
5 5
 	"io"
6 6
 	"strings"
7 7
 
8
+	"github.com/docker/docker/api/types/blkiodev"
8 9
 	"github.com/docker/docker/api/types/strslice"
9
-	"github.com/docker/docker/pkg/blkiodev"
10 10
 	"github.com/docker/docker/pkg/nat"
11 11
 	"github.com/docker/docker/pkg/ulimit"
12 12
 )