2016-01-27 22:09:42 +00:00
// Package backend includes types to send information to server backends.
2018-02-05 21:05:59 +00:00
package backend // import "github.com/docker/docker/api/types/backend"
2016-01-27 22:09:42 +00:00
import (
"io"
2017-03-20 17:07:04 +00:00
"time"
2016-01-27 22:09:42 +00:00
2017-04-21 19:08:11 +00:00
"github.com/docker/docker/api/types/container"
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
2017-02-16 15:56:53 +00:00
// Used to signify that streams are multiplexed and therefore need a StdWriter to encode stdout/stderr messages accordingly.
2016-01-05 21:23:24 +00:00
// 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
}
2017-12-19 02:26:55 +00:00
// PartialLogMetaData provides meta data for a partial log message. Messages
// exceeding a predefined size are split into chunks with this metadata. The
// expectation is for the logger endpoints to assemble the chunks using this
// metadata.
type PartialLogMetaData struct {
2019-11-27 14:37:30 +00:00
Last bool // true if this message is last of a partial
2017-12-19 02:26:55 +00:00
ID string // identifies group of messages comprising a single record
Ordinal int // ordering of message in partial group
}
2017-03-20 17:07:04 +00:00
// LogMessage is datastructure that represents piece of output produced by some
// container. The Line member is a slice of an array whose contents can be
// changed after a log driver's Log() method returns.
// changes to this struct need to be reflect in the reset method in
// daemon/logger/logger.go
type LogMessage struct {
2017-12-19 02:26:55 +00:00
Line [ ] byte
Source string
Timestamp time . Time
Attrs [ ] LogAttr
PLogMetaData * PartialLogMetaData
2017-03-20 17:07:04 +00:00
// Err is an error associated with a message. Completeness of a message
// with Err is not expected, tho it may be partially complete (fields may
// be missing, gibberish, or nil)
Err error
2016-01-27 22:09:42 +00:00
}
2017-07-19 02:01:20 +00:00
// LogAttr is used to hold the extra attributes available in the log message.
type LogAttr struct {
Key string
Value string
}
2017-03-20 17:07:04 +00:00
2017-03-21 18:35:55 +00:00
// LogSelector is a list of services and tasks that should be returned as part
// of a log stream. It is similar to swarmapi.LogSelector, with the difference
// that the names don't have to be resolved to IDs; this is mostly to avoid
// accidents later where a swarmapi LogSelector might have been incorrectly
// used verbatim (and to avoid the handler having to import swarmapi types)
type LogSelector struct {
Services [ ] string
Tasks [ ] string
}
2016-01-27 22:09:42 +00:00
// ContainerStatsConfig holds information for configuring the runtime
// behavior of a backend.ContainerStats() call.
type ContainerStatsConfig struct {
Stream bool
2020-02-07 23:55:06 +00:00
OneShot bool
2016-01-27 22:09:42 +00:00
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
2016-10-17 17:49:36 +00:00
Pid int
2016-02-10 20:16:59 +00:00
}
// 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
2018-02-06 18:27:55 +00:00
// CreateImageConfig is the configuration for creating an image from a
// container.
type CreateImageConfig struct {
Repo string
Tag string
Pause bool
Author string
Comment string
Config * container . Config
2016-03-16 23:07:41 +00:00
Changes [ ] string
2018-02-06 18:27:55 +00:00
}
// CommitConfig is the configuration for creating an image as part of a build.
type CommitConfig struct {
Author string
Comment string
Config * container . Config
ContainerConfig * container . Config
ContainerID string
ContainerMountLabel string
ContainerOS string
ParentImageID string
2016-03-16 23:07:41 +00:00
}