move configs structs to remove dependency on daemon

- Moved the following config structs to api/types
   - ContainerRmConfig
   - ContainerCommitConfig

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 63fb931a0b7298c6281898bcc5f53ab0655ad1a6
Component: engine
This commit is contained in:
Morgan Bauer
2015-12-07 09:03:25 -08:00
parent fee5b92987
commit b12523fdf4
11 changed files with 49 additions and 34 deletions
@@ -38,7 +38,7 @@ type stateBackend interface {
ContainerRename(oldName, newName string) error
ContainerResize(name string, height, width int) error
ContainerRestart(name string, seconds int) error
ContainerRm(name string, config *daemon.ContainerRmConfig) error
ContainerRm(name string, config *types.ContainerRmConfig) error
ContainerStart(name string, hostConfig *runconfig.HostConfig) error
ContainerStop(name string, seconds int) error
ContainerUnpause(name string) error
@@ -358,7 +358,7 @@ func (s *containerRouter) deleteContainers(ctx context.Context, w http.ResponseW
}
name := vars["name"]
config := &daemon.ContainerRmConfig{
config := &types.ContainerRmConfig{
ForceRemove: httputils.BoolValue(r, "force"),
RemoveVolume: httputils.BoolValue(r, "v"),
RemoveLink: httputils.BoolValue(r, "link"),
+29
View File
@@ -0,0 +1,29 @@
package types
// configs holds structs used for internal communication between the
// frontend (such as an http server) and the backend (such as the
// docker daemon).
import (
"github.com/docker/docker/runconfig"
)
// ContainerRmConfig holds arguments for the container remove
// operation. This struct is used to tell the backend what operations
// to perform.
type ContainerRmConfig struct {
ForceRemove, RemoveVolume, RemoveLink bool
}
// ContainerCommitConfig contains build configs for commit operation,
// and is used when making a commit with the current state of the container.
type ContainerCommitConfig struct {
Pause bool
Repo string
Tag string
Author string
Comment string
// merge container config into commit config before commit
MergeConfigs bool
Config *runconfig.Config
}