backend.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. import (
  6. "io"
  7. "net/http"
  8. "github.com/docker/engine-api/types"
  9. )
  10. // ContainerAttachWithLogsConfig holds the streams to use when connecting to a container to view logs.
  11. type ContainerAttachWithLogsConfig struct {
  12. Hijacker http.Hijacker
  13. Upgrade bool
  14. UseStdin bool
  15. UseStdout bool
  16. UseStderr bool
  17. Logs bool
  18. Stream bool
  19. DetachKeys []byte
  20. }
  21. // ContainerWsAttachWithLogsConfig attach with websockets, since all
  22. // stream data is delegated to the websocket to handle there.
  23. type ContainerWsAttachWithLogsConfig struct {
  24. InStream io.ReadCloser // Reader to attach to stdin of container
  25. OutStream io.Writer // Writer to attach to stdout of container
  26. ErrStream io.Writer // Writer to attach to stderr of container
  27. Logs bool // If true return log output
  28. Stream bool // If true return stream output
  29. DetachKeys []byte
  30. }
  31. // ContainerLogsConfig holds configs for logging operations. Exists
  32. // for users of the backend to to pass it a logging configuration.
  33. type ContainerLogsConfig struct {
  34. types.ContainerLogsOptions
  35. OutStream io.Writer
  36. Stop <-chan bool
  37. }
  38. // ContainerStatsConfig holds information for configuring the runtime
  39. // behavior of a backend.ContainerStats() call.
  40. type ContainerStatsConfig struct {
  41. Stream bool
  42. OutStream io.Writer
  43. Stop <-chan bool
  44. Version string
  45. }