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