Use an interface to specify the behavior of a configuration decoder. Signed-off-by: David Calavera <david.calavera@gmail.com> Upstream-commit: f0d26e1665f7552972db5b041554cc7b45bc3060 Component: engine
17 lines
434 B
Go
17 lines
434 B
Go
package httputils
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/docker/engine-api/types/container"
|
|
"github.com/docker/engine-api/types/network"
|
|
)
|
|
|
|
// ContainerDecoder specifies how
|
|
// to translate an io.Reader into
|
|
// container configuration.
|
|
type ContainerDecoder interface {
|
|
DecodeConfig(src io.Reader) (*container.Config, *container.HostConfig, *network.NetworkingConfig, error)
|
|
DecodeHostConfig(src io.Reader) (*container.HostConfig, error)
|
|
}
|