2016-01-27 22:09:42 +00:00
// Package backend includes types to send information to server backends.
package backend
import (
"io"
2016-09-06 18:18:12 +00:00
"github.com/docker/docker/api/types"
2016-03-29 22:51:14 +00:00
"github.com/docker/docker/pkg/streamformatter"
2016-01-27 22:09:42 +00:00
)
2016-01-05 21:23:24 +00:00
// ContainerAttachConfig holds the streams to use when connecting to a container to view logs.
type ContainerAttachConfig struct {
GetStreams func ( ) ( io . ReadCloser , io . Writer , io . Writer , error )
2016-01-27 22:09:42 +00:00
UseStdin bool
UseStdout bool
UseStderr bool
Logs bool
Stream bool
2016-03-23 11:34:47 +00:00
DetachKeys string
2016-01-27 22:09:42 +00:00
2016-01-05 21:23:24 +00:00
// Used to signify that streams are multiplexed and therefore need a StdWriter to encode stdout/sderr messages accordingly.
// TODO @cpuguy83: This shouldn't be needed. It was only added so that http and websocket endpoints can use the same function, and the websocket function was not using a stdwriter prior to this change...
// HOWEVER, the websocket endpoint is using a single stream and SHOULD be encoded with stdout/stderr as is done for HTTP since it is still just a single stream.
// Since such a change is an API change unrelated to the current changeset we'll keep it as is here and change separately.
MuxStreams bool
2016-01-27 22:09:42 +00:00
}
// ContainerLogsConfig holds configs for logging operations. Exists
// for users of the backend to to pass it a logging configuration.
type ContainerLogsConfig struct {
types . ContainerLogsOptions
OutStream io . Writer
}
// ContainerStatsConfig holds information for configuring the runtime
// behavior of a backend.ContainerStats() call.
type ContainerStatsConfig struct {
Stream bool
OutStream io . Writer
Version string
}
2016-02-10 20:16:59 +00:00
// ExecInspect holds information about a running process started
// with docker exec.
type ExecInspect struct {
ID string
Running bool
ExitCode * int
ProcessConfig * ExecProcessConfig
OpenStdin bool
OpenStderr bool
OpenStdout bool
CanRemove bool
ContainerID string
DetachKeys [ ] byte
}
// ExecProcessConfig holds information about the exec process
// running on the host.
type ExecProcessConfig struct {
Tty bool ` json:"tty" `
Entrypoint string ` json:"entrypoint" `
Arguments [ ] string ` json:"arguments" `
Privileged * bool ` json:"privileged,omitempty" `
User string ` json:"user,omitempty" `
}
2016-03-16 23:07:41 +00:00
// ContainerCommitConfig is a wrapper around
// types.ContainerCommitConfig that also
// transports configuration changes for a container.
type ContainerCommitConfig struct {
types . ContainerCommitConfig
Changes [ ] string
}
2016-03-29 22:51:14 +00:00
// ProgressWriter is an interface
// to transport progress streams.
type ProgressWriter struct {
Output io . Writer
StdoutFormatter * streamformatter . StdoutFormatter
StderrFormatter * streamformatter . StderrFormatter
ProgressReaderFunc func ( io . ReadCloser ) io . ReadCloser
}