github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/api/types/backend/backend.go (about) 1 // Package backend includes types to send information to server backends. 2 package backend 3 4 import ( 5 "io" 6 7 "github.com/docker/docker/api/types" 8 "github.com/docker/docker/pkg/streamformatter" 9 ) 10 11 // ContainerAttachConfig holds the streams to use when connecting to a container to view logs. 12 type ContainerAttachConfig struct { 13 GetStreams func() (io.ReadCloser, io.Writer, io.Writer, error) 14 UseStdin bool 15 UseStdout bool 16 UseStderr bool 17 Logs bool 18 Stream bool 19 DetachKeys string 20 21 // Used to signify that streams are multiplexed and therefore need a StdWriter to encode stdout/sderr messages accordingly. 22 // 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... 23 // 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. 24 // Since such a change is an API change unrelated to the current changeset we'll keep it as is here and change separately. 25 MuxStreams bool 26 } 27 28 // ContainerLogsConfig holds configs for logging operations. Exists 29 // for users of the backend to to pass it a logging configuration. 30 type ContainerLogsConfig struct { 31 types.ContainerLogsOptions 32 OutStream io.Writer 33 } 34 35 // ContainerStatsConfig holds information for configuring the runtime 36 // behavior of a backend.ContainerStats() call. 37 type ContainerStatsConfig struct { 38 Stream bool 39 OutStream io.Writer 40 Version string 41 } 42 43 // ExecInspect holds information about a running process started 44 // with docker exec. 45 type ExecInspect struct { 46 ID string 47 Running bool 48 ExitCode *int 49 ProcessConfig *ExecProcessConfig 50 OpenStdin bool 51 OpenStderr bool 52 OpenStdout bool 53 CanRemove bool 54 ContainerID string 55 DetachKeys []byte 56 } 57 58 // ExecProcessConfig holds information about the exec process 59 // running on the host. 60 type ExecProcessConfig struct { 61 Tty bool `json:"tty"` 62 Entrypoint string `json:"entrypoint"` 63 Arguments []string `json:"arguments"` 64 Privileged *bool `json:"privileged,omitempty"` 65 User string `json:"user,omitempty"` 66 } 67 68 // ContainerCommitConfig is a wrapper around 69 // types.ContainerCommitConfig that also 70 // transports configuration changes for a container. 71 type ContainerCommitConfig struct { 72 types.ContainerCommitConfig 73 Changes []string 74 } 75 76 // ProgressWriter is an interface 77 // to transport progress streams. 78 type ProgressWriter struct { 79 Output io.Writer 80 StdoutFormatter *streamformatter.StdoutFormatter 81 StderrFormatter *streamformatter.StderrFormatter 82 ProgressReaderFunc func(io.ReadCloser) io.ReadCloser 83 }