github.com/rita33cool1/iot-system-gateway@v0.0.0-20200911033302-e65bde238cc5/docker-engine/api/types/backend/backend.go (about)

     1  // Package backend includes types to send information to server backends.
     2  package backend // import "github.com/docker/docker/api/types/backend"
     3  
     4  import (
     5  	"io"
     6  	"time"
     7  
     8  	"github.com/docker/docker/api/types/container"
     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/stderr 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  // LogMessage is datastructure that represents piece of output produced by some
    29  // container.  The Line member is a slice of an array whose contents can be
    30  // changed after a log driver's Log() method returns.
    31  // changes to this struct need to be reflect in the reset method in
    32  // daemon/logger/logger.go
    33  type LogMessage struct {
    34  	Line      []byte
    35  	Source    string
    36  	Timestamp time.Time
    37  	Attrs     []LogAttr
    38  	Partial   bool
    39  
    40  	// Err is an error associated with a message. Completeness of a message
    41  	// with Err is not expected, tho it may be partially complete (fields may
    42  	// be missing, gibberish, or nil)
    43  	Err error
    44  }
    45  
    46  // LogAttr is used to hold the extra attributes available in the log message.
    47  type LogAttr struct {
    48  	Key   string
    49  	Value string
    50  }
    51  
    52  // LogSelector is a list of services and tasks that should be returned as part
    53  // of a log stream. It is similar to swarmapi.LogSelector, with the difference
    54  // that the names don't have to be resolved to IDs; this is mostly to avoid
    55  // accidents later where a swarmapi LogSelector might have been incorrectly
    56  // used verbatim (and to avoid the handler having to import swarmapi types)
    57  type LogSelector struct {
    58  	Services []string
    59  	Tasks    []string
    60  }
    61  
    62  // ContainerStatsConfig holds information for configuring the runtime
    63  // behavior of a backend.ContainerStats() call.
    64  type ContainerStatsConfig struct {
    65  	Stream    bool
    66  	OutStream io.Writer
    67  	Version   string
    68  }
    69  
    70  // ExecInspect holds information about a running process started
    71  // with docker exec.
    72  type ExecInspect struct {
    73  	ID            string
    74  	Running       bool
    75  	ExitCode      *int
    76  	ProcessConfig *ExecProcessConfig
    77  	OpenStdin     bool
    78  	OpenStderr    bool
    79  	OpenStdout    bool
    80  	CanRemove     bool
    81  	ContainerID   string
    82  	DetachKeys    []byte
    83  	Pid           int
    84  }
    85  
    86  // ExecProcessConfig holds information about the exec process
    87  // running on the host.
    88  type ExecProcessConfig struct {
    89  	Tty        bool     `json:"tty"`
    90  	Entrypoint string   `json:"entrypoint"`
    91  	Arguments  []string `json:"arguments"`
    92  	Privileged *bool    `json:"privileged,omitempty"`
    93  	User       string   `json:"user,omitempty"`
    94  }
    95  
    96  // CreateImageConfig is the configuration for creating an image from a
    97  // container.
    98  type CreateImageConfig struct {
    99  	Repo    string
   100  	Tag     string
   101  	Pause   bool
   102  	Author  string
   103  	Comment string
   104  	Config  *container.Config
   105  	Changes []string
   106  }
   107  
   108  // CommitConfig is the configuration for creating an image as part of a build.
   109  type CommitConfig struct {
   110  	Author              string
   111  	Comment             string
   112  	Config              *container.Config
   113  	ContainerConfig     *container.Config
   114  	ContainerID         string
   115  	ContainerMountLabel string
   116  	ContainerOS         string
   117  	ParentImageID       string
   118  }