repo
stringlengths
6
47
file_url
stringlengths
77
269
file_path
stringlengths
5
186
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-07 08:35:43
2026-01-07 08:55:24
truncated
bool
2 classes
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/pkg/ioutils/fswriters_deprecated.go
vendor/github.com/docker/docker/pkg/ioutils/fswriters_deprecated.go
package ioutils import ( "io" "os" "github.com/moby/sys/atomicwriter" ) // NewAtomicFileWriter returns WriteCloser so that writing to it writes to a // temporary file and closing it atomically changes the temporary file to // destination path. Writing and closing concurrently is not allowed. // NOTE: umask is not considered for the file's permissions. // // Deprecated: use [atomicwriter.New] instead. func NewAtomicFileWriter(filename string, perm os.FileMode) (io.WriteCloser, error) { return atomicwriter.New(filename, perm) } // AtomicWriteFile atomically writes data to a file named by filename and with the specified permission bits. // NOTE: umask is not considered for the file's permissions. // // Deprecated: use [atomicwriter.WriteFile] instead. func AtomicWriteFile(filename string, data []byte, perm os.FileMode) error { return atomicwriter.WriteFile(filename, data, perm) } // AtomicWriteSet is used to atomically write a set // of files and ensure they are visible at the same time. // Must be committed to a new directory. // // Deprecated: use [atomicwriter.WriteSet] instead. type AtomicWriteSet = atomicwriter.WriteSet // NewAtomicWriteSet creates a new atomic write set to // atomically create a set of files. The given directory // is used as the base directory for storing files before // commit. If no temporary directory is given the system // default is used. // // Deprecated: use [atomicwriter.NewWriteSet] instead. func NewAtomicWriteSet(tmpDir string) (*atomicwriter.WriteSet, error) { return atomicwriter.NewWriteSet(tmpDir) }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/pkg/ioutils/writers.go
vendor/github.com/docker/docker/pkg/ioutils/writers.go
package ioutils import ( "io" "sync/atomic" ) type writeCloserWrapper struct { io.Writer closer func() error closed atomic.Bool } func (r *writeCloserWrapper) Close() error { if !r.closed.CompareAndSwap(false, true) { subsequentCloseWarn("WriteCloserWrapper") return nil } return r.closer() } // NewWriteCloserWrapper returns a new io.WriteCloser. func NewWriteCloserWrapper(r io.Writer, closer func() error) io.WriteCloser { return &writeCloserWrapper{ Writer: r, closer: closer, } }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go
vendor/github.com/docker/docker/pkg/ioutils/writeflusher.go
package ioutils import ( "io" "sync" ) // WriteFlusher wraps the Write and Flush operation ensuring that every write // is a flush. In addition, the Close method can be called to intercept // Read/Write calls if the targets lifecycle has already ended. type WriteFlusher struct { w io.Writer flusher flusher flushed chan struct{} flushedOnce sync.Once closed chan struct{} closeLock sync.Mutex } type flusher interface { Flush() } func (wf *WriteFlusher) Write(b []byte) (int, error) { select { case <-wf.closed: return 0, io.EOF default: } n, err := wf.w.Write(b) wf.Flush() // every write is a flush. return n, err } // Flush the stream immediately. func (wf *WriteFlusher) Flush() { select { case <-wf.closed: return default: } wf.flushedOnce.Do(func() { close(wf.flushed) }) wf.flusher.Flush() } // Flushed returns the state of flushed. // If it's flushed, return true, or else it return false. func (wf *WriteFlusher) Flushed() bool { // BUG(stevvooe): Remove this method. Its use is inherently racy. Seems to // be used to detect whether or a response code has been issued or not. // Another hook should be used instead. var flushed bool select { case <-wf.flushed: flushed = true default: } return flushed } // Close closes the write flusher, disallowing any further writes to the // target. After the flusher is closed, all calls to write or flush will // result in an error. func (wf *WriteFlusher) Close() error { wf.closeLock.Lock() defer wf.closeLock.Unlock() select { case <-wf.closed: return io.EOF default: close(wf.closed) } return nil } // nopFlusher represents a type which flush operation is nop. type nopFlusher struct{} // Flush is a nop operation. func (f *nopFlusher) Flush() {} // NewWriteFlusher returns a new WriteFlusher. func NewWriteFlusher(w io.Writer) *WriteFlusher { var fl flusher if f, ok := w.(flusher); ok { fl = f } else { fl = &nopFlusher{} } return &WriteFlusher{w: w, flusher: fl, closed: make(chan struct{}), flushed: make(chan struct{})} }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/pkg/stdcopy/stdcopy.go
vendor/github.com/docker/docker/pkg/stdcopy/stdcopy.go
package stdcopy import ( "bytes" "encoding/binary" "errors" "fmt" "io" "sync" ) // StdType is the type of standard stream // a writer can multiplex to. type StdType byte const ( // Stdin represents standard input stream type. Stdin StdType = iota // Stdout represents standard output stream type. Stdout // Stderr represents standard error steam type. Stderr // Systemerr represents errors originating from the system that make it // into the multiplexed stream. Systemerr stdWriterPrefixLen = 8 stdWriterFdIndex = 0 stdWriterSizeIndex = 4 startingBufLen = 32*1024 + stdWriterPrefixLen + 1 ) var bufPool = &sync.Pool{New: func() interface{} { return bytes.NewBuffer(nil) }} // stdWriter is wrapper of io.Writer with extra customized info. type stdWriter struct { io.Writer prefix byte } // Write sends the buffer to the underneath writer. // It inserts the prefix header before the buffer, // so stdcopy.StdCopy knows where to multiplex the output. // It makes stdWriter to implement io.Writer. func (w *stdWriter) Write(p []byte) (int, error) { if w == nil || w.Writer == nil { return 0, errors.New("writer not instantiated") } if p == nil { return 0, nil } header := [stdWriterPrefixLen]byte{stdWriterFdIndex: w.prefix} binary.BigEndian.PutUint32(header[stdWriterSizeIndex:], uint32(len(p))) buf := bufPool.Get().(*bytes.Buffer) buf.Write(header[:]) buf.Write(p) n, err := w.Writer.Write(buf.Bytes()) n -= stdWriterPrefixLen if n < 0 { n = 0 } buf.Reset() bufPool.Put(buf) return n, err } // NewStdWriter instantiates a new Writer. // Everything written to it will be encapsulated using a custom format, // and written to the underlying `w` stream. // This allows multiple write streams (e.g. stdout and stderr) to be muxed into a single connection. // `t` indicates the id of the stream to encapsulate. // It can be stdcopy.Stdin, stdcopy.Stdout, stdcopy.Stderr. func NewStdWriter(w io.Writer, t StdType) io.Writer { return &stdWriter{ Writer: w, prefix: byte(t), } } // StdCopy is a modified version of io.Copy. // // StdCopy will demultiplex `src`, assuming that it contains two streams, // previously multiplexed together using a StdWriter instance. // As it reads from `src`, StdCopy will write to `dstout` and `dsterr`. // // StdCopy will read until it hits EOF on `src`. It will then return a nil error. // In other words: if `err` is non nil, it indicates a real underlying error. // // `written` will hold the total number of bytes written to `dstout` and `dsterr`. func StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, _ error) { var ( buf = make([]byte, startingBufLen) bufLen = len(buf) nr, nw int err error out io.Writer frameSize int ) for { // Make sure we have at least a full header for nr < stdWriterPrefixLen { var nr2 int nr2, err = src.Read(buf[nr:]) nr += nr2 if errors.Is(err, io.EOF) { if nr < stdWriterPrefixLen { return written, nil } break } if err != nil { return 0, err } } stream := StdType(buf[stdWriterFdIndex]) // Check the first byte to know where to write switch stream { case Stdin: fallthrough case Stdout: // Write on stdout out = dstout case Stderr: // Write on stderr out = dsterr case Systemerr: // If we're on Systemerr, we won't write anywhere. // NB: if this code changes later, make sure you don't try to write // to outstream if Systemerr is the stream out = nil default: return 0, fmt.Errorf("Unrecognized input header: %d", buf[stdWriterFdIndex]) } // Retrieve the size of the frame frameSize = int(binary.BigEndian.Uint32(buf[stdWriterSizeIndex : stdWriterSizeIndex+4])) // Check if the buffer is big enough to read the frame. // Extend it if necessary. if frameSize+stdWriterPrefixLen > bufLen { buf = append(buf, make([]byte, frameSize+stdWriterPrefixLen-bufLen+1)...) bufLen = len(buf) } // While the amount of bytes read is less than the size of the frame + header, we keep reading for nr < frameSize+stdWriterPrefixLen { var nr2 int nr2, err = src.Read(buf[nr:]) nr += nr2 if errors.Is(err, io.EOF) { if nr < frameSize+stdWriterPrefixLen { return written, nil } break } if err != nil { return 0, err } } // we might have an error from the source mixed up in our multiplexed // stream. if we do, return it. if stream == Systemerr { return written, fmt.Errorf("error from daemon in stream: %s", string(buf[stdWriterPrefixLen:frameSize+stdWriterPrefixLen])) } // Write the retrieved frame (without header) nw, err = out.Write(buf[stdWriterPrefixLen : frameSize+stdWriterPrefixLen]) if err != nil { return 0, err } // If the frame has not been fully written: error if nw != frameSize { return 0, io.ErrShortWrite } written += int64(nw) // Move the rest of the buffer to the beginning copy(buf, buf[frameSize+stdWriterPrefixLen:]) // Move the index nr -= frameSize + stdWriterPrefixLen } }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/common.go
vendor/github.com/docker/docker/api/common.go
package api // Common constants for daemon and client. const ( // DefaultVersion of the current REST API. DefaultVersion = "1.51" // MinSupportedAPIVersion is the minimum API version that can be supported // by the API server, specified as "major.minor". Note that the daemon // may be configured with a different minimum API version, as returned // in [github.com/docker/docker/api/types.Version.MinAPIVersion]. // // API requests for API versions lower than the configured version produce // an error. MinSupportedAPIVersion = "1.24" // NoBaseImageSpecifier is the symbol used by the FROM // command to specify that no base image is to be used. NoBaseImageSpecifier = "scratch" )
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/client.go
vendor/github.com/docker/docker/api/types/client.go
package types import ( "bufio" "context" "net" ) // NewHijackedResponse initializes a [HijackedResponse] type. func NewHijackedResponse(conn net.Conn, mediaType string) HijackedResponse { return HijackedResponse{Conn: conn, Reader: bufio.NewReader(conn), mediaType: mediaType} } // HijackedResponse holds connection information for a hijacked request. type HijackedResponse struct { mediaType string Conn net.Conn Reader *bufio.Reader } // Close closes the hijacked connection and reader. func (h *HijackedResponse) Close() { h.Conn.Close() } // MediaType let client know if HijackedResponse hold a raw or multiplexed stream. // returns false if HTTP Content-Type is not relevant, and container must be inspected func (h *HijackedResponse) MediaType() (string, bool) { if h.mediaType == "" { return "", false } return h.mediaType, true } // CloseWriter is an interface that implements structs // that close input streams to prevent from writing. type CloseWriter interface { CloseWrite() error } // CloseWrite closes a readWriter for writing. func (h *HijackedResponse) CloseWrite() error { if conn, ok := h.Conn.(CloseWriter); ok { return conn.CloseWrite() } return nil } // PluginRemoveOptions holds parameters to remove plugins. type PluginRemoveOptions struct { Force bool } // PluginEnableOptions holds parameters to enable plugins. type PluginEnableOptions struct { Timeout int } // PluginDisableOptions holds parameters to disable plugins. type PluginDisableOptions struct { Force bool } // PluginInstallOptions holds parameters to install a plugin. type PluginInstallOptions struct { Disabled bool AcceptAllPermissions bool RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry RemoteRef string // RemoteRef is the plugin name on the registry // PrivilegeFunc is a function that clients can supply to retry operations // after getting an authorization error. This function returns the registry // authentication header value in base64 encoded format, or an error if the // privilege request fails. // // For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. PrivilegeFunc func(context.Context) (string, error) AcceptPermissionsFunc func(context.Context, PluginPrivileges) (bool, error) Args []string } // PluginCreateOptions hold all options to plugin create. type PluginCreateOptions struct { RepoName string }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/plugin_responses.go
vendor/github.com/docker/docker/api/types/plugin_responses.go
package types import ( "encoding/json" "fmt" "sort" ) // PluginsListResponse contains the response for the Engine API type PluginsListResponse []*Plugin // UnmarshalJSON implements json.Unmarshaler for PluginInterfaceType func (t *PluginInterfaceType) UnmarshalJSON(p []byte) error { versionIndex := len(p) prefixIndex := 0 if len(p) < 2 || p[0] != '"' || p[len(p)-1] != '"' { return fmt.Errorf("%q is not a plugin interface type", p) } p = p[1 : len(p)-1] loop: for i, b := range p { switch b { case '.': prefixIndex = i case '/': versionIndex = i break loop } } t.Prefix = string(p[:prefixIndex]) t.Capability = string(p[prefixIndex+1 : versionIndex]) if versionIndex < len(p) { t.Version = string(p[versionIndex+1:]) } return nil } // MarshalJSON implements json.Marshaler for PluginInterfaceType func (t *PluginInterfaceType) MarshalJSON() ([]byte, error) { return json.Marshal(t.String()) } // String implements fmt.Stringer for PluginInterfaceType func (t PluginInterfaceType) String() string { return fmt.Sprintf("%s.%s/%s", t.Prefix, t.Capability, t.Version) } // PluginPrivilege describes a permission the user has to accept // upon installing a plugin. type PluginPrivilege struct { Name string Description string Value []string } // PluginPrivileges is a list of PluginPrivilege type PluginPrivileges []PluginPrivilege func (s PluginPrivileges) Len() int { return len(s) } func (s PluginPrivileges) Less(i, j int) bool { return s[i].Name < s[j].Name } func (s PluginPrivileges) Swap(i, j int) { sort.Strings(s[i].Value) sort.Strings(s[j].Value) s[i], s[j] = s[j], s[i] }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/types.go
vendor/github.com/docker/docker/api/types/types.go
package types import ( "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/volume" ) const ( // MediaTypeRawStream is vendor specific MIME-Type set for raw TTY streams MediaTypeRawStream = "application/vnd.docker.raw-stream" // MediaTypeMultiplexedStream is vendor specific MIME-Type set for stdin/stdout/stderr multiplexed streams MediaTypeMultiplexedStream = "application/vnd.docker.multiplexed-stream" ) // Ping contains response of Engine API: // GET "/_ping" type Ping struct { APIVersion string OSType string Experimental bool BuilderVersion build.BuilderVersion // SwarmStatus provides information about the current swarm status of the // engine, obtained from the "Swarm" header in the API response. // // It can be a nil struct if the API version does not provide this header // in the ping response, or if an error occurred, in which case the client // should use other ways to get the current swarm status, such as the /swarm // endpoint. SwarmStatus *swarm.Status } // ComponentVersion describes the version information for a specific component. type ComponentVersion struct { Name string Version string Details map[string]string `json:",omitempty"` } // Version contains response of Engine API: // GET "/version" type Version struct { Platform struct{ Name string } `json:",omitempty"` Components []ComponentVersion `json:",omitempty"` // The following fields are deprecated, they relate to the Engine component and are kept for backwards compatibility Version string APIVersion string `json:"ApiVersion"` MinAPIVersion string `json:"MinAPIVersion,omitempty"` GitCommit string GoVersion string Os string Arch string KernelVersion string `json:",omitempty"` Experimental bool `json:",omitempty"` BuildTime string `json:",omitempty"` } // DiskUsageObject represents an object type used for disk usage query filtering. type DiskUsageObject string const ( // ContainerObject represents a container DiskUsageObject. ContainerObject DiskUsageObject = "container" // ImageObject represents an image DiskUsageObject. ImageObject DiskUsageObject = "image" // VolumeObject represents a volume DiskUsageObject. VolumeObject DiskUsageObject = "volume" // BuildCacheObject represents a build-cache DiskUsageObject. BuildCacheObject DiskUsageObject = "build-cache" ) // DiskUsageOptions holds parameters for system disk usage query. type DiskUsageOptions struct { // Types specifies what object types to include in the response. If empty, // all object types are returned. Types []DiskUsageObject } // DiskUsage contains response of Engine API: // GET "/system/df" type DiskUsage struct { LayersSize int64 Images []*image.Summary Containers []*container.Summary Volumes []*volume.Volume BuildCache []*build.CacheRecord BuilderSize int64 `json:",omitempty"` // Deprecated: deprecated in API 1.38, and no longer used since API 1.40. } // PushResult contains the tag, manifest digest, and manifest size from the // push. It's used to signal this information to the trust code in the client // so it can sign the manifest if necessary. type PushResult struct { Tag string Digest string Size int }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/plugin_interface_type.go
vendor/github.com/docker/docker/api/types/plugin_interface_type.go
package types // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // PluginInterfaceType plugin interface type // swagger:model PluginInterfaceType type PluginInterfaceType struct { // capability // Required: true Capability string `json:"Capability"` // prefix // Required: true Prefix string `json:"Prefix"` // version // Required: true Version string `json:"Version"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/error_response_ext.go
vendor/github.com/docker/docker/api/types/error_response_ext.go
package types // Error returns the error message func (e ErrorResponse) Error() string { return e.Message }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/plugin_env.go
vendor/github.com/docker/docker/api/types/plugin_env.go
package types // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // PluginEnv plugin env // swagger:model PluginEnv type PluginEnv struct { // description // Required: true Description string `json:"Description"` // name // Required: true Name string `json:"Name"` // settable // Required: true Settable []string `json:"Settable"` // value // Required: true Value *string `json:"Value"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/types_deprecated.go
vendor/github.com/docker/docker/api/types/types_deprecated.go
package types import ( "context" "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/common" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/storage" "github.com/docker/docker/api/types/swarm" ) // IDResponse Response to an API call that returns just an Id. // // Deprecated: use either [container.CommitResponse] or [container.ExecCreateResponse]. It will be removed in the next release. type IDResponse = common.IDResponse // ContainerJSONBase contains response of Engine API GET "/containers/{name:.*}/json" // for API version 1.18 and older. // // Deprecated: use [container.InspectResponse] or [container.ContainerJSONBase]. It will be removed in the next release. type ContainerJSONBase = container.ContainerJSONBase // ContainerJSON is the response for the GET "/containers/{name:.*}/json" // endpoint. // // Deprecated: use [container.InspectResponse]. It will be removed in the next release. type ContainerJSON = container.InspectResponse // Container contains response of Engine API: // GET "/containers/json" // // Deprecated: use [container.Summary]. type Container = container.Summary // ContainerState stores container's running state // // Deprecated: use [container.State]. type ContainerState = container.State // NetworkSettings exposes the network settings in the api. // // Deprecated: use [container.NetworkSettings]. type NetworkSettings = container.NetworkSettings // NetworkSettingsBase holds networking state for a container when inspecting it. // // Deprecated: [container.NetworkSettingsBase] will be removed in v29. Prefer // accessing the fields it contains through [container.NetworkSettings]. type NetworkSettingsBase = container.NetworkSettingsBase //nolint:staticcheck // ignore SA1019: NetworkSettingsBase is deprecated in v28.4. // DefaultNetworkSettings holds network information // during the 2 release deprecation period. // It will be removed in Docker 1.11. // // Deprecated: use [container.DefaultNetworkSettings]. type DefaultNetworkSettings = container.DefaultNetworkSettings //nolint:staticcheck // ignore SA1019: DefaultNetworkSettings is deprecated in v28.4. // SummaryNetworkSettings provides a summary of container's networks // in /containers/json. // // Deprecated: use [container.NetworkSettingsSummary]. type SummaryNetworkSettings = container.NetworkSettingsSummary // Health states const ( NoHealthcheck = container.NoHealthcheck // Deprecated: use [container.NoHealthcheck]. Starting = container.Starting // Deprecated: use [container.Starting]. Healthy = container.Healthy // Deprecated: use [container.Healthy]. Unhealthy = container.Unhealthy // Deprecated: use [container.Unhealthy]. ) // Health stores information about the container's healthcheck results. // // Deprecated: use [container.Health]. type Health = container.Health // HealthcheckResult stores information about a single run of a healthcheck probe. // // Deprecated: use [container.HealthcheckResult]. type HealthcheckResult = container.HealthcheckResult // MountPoint represents a mount point configuration inside the container. // This is used for reporting the mountpoints in use by a container. // // Deprecated: use [container.MountPoint]. type MountPoint = container.MountPoint // Port An open port on a container // // Deprecated: use [container.Port]. type Port = container.Port // GraphDriverData Information about the storage driver used to store the container's and // image's filesystem. // // Deprecated: use [storage.DriverData]. type GraphDriverData = storage.DriverData // RootFS returns Image's RootFS description including the layer IDs. // // Deprecated: use [image.RootFS]. type RootFS = image.RootFS // ImageInspect contains response of Engine API: // GET "/images/{name:.*}/json" // // Deprecated: use [image.InspectResponse]. type ImageInspect = image.InspectResponse // RequestPrivilegeFunc is a function interface that clients can supply to // retry operations after getting an authorization error. // This function returns the registry authentication header value in base64 // format, or an error if the privilege request fails. // // Deprecated: moved to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. type RequestPrivilegeFunc func(context.Context) (string, error) // SecretCreateResponse contains the information returned to a client // on the creation of a new secret. // // Deprecated: use [swarm.SecretCreateResponse]. type SecretCreateResponse = swarm.SecretCreateResponse // SecretListOptions holds parameters to list secrets // // Deprecated: use [swarm.SecretListOptions]. type SecretListOptions = swarm.SecretListOptions // ConfigCreateResponse contains the information returned to a client // on the creation of a new config. // // Deprecated: use [swarm.ConfigCreateResponse]. type ConfigCreateResponse = swarm.ConfigCreateResponse // ConfigListOptions holds parameters to list configs // // Deprecated: use [swarm.ConfigListOptions]. type ConfigListOptions = swarm.ConfigListOptions // NodeListOptions holds parameters to list nodes with. // // Deprecated: use [swarm.NodeListOptions]. type NodeListOptions = swarm.NodeListOptions // NodeRemoveOptions holds parameters to remove nodes with. // // Deprecated: use [swarm.NodeRemoveOptions]. type NodeRemoveOptions = swarm.NodeRemoveOptions // TaskListOptions holds parameters to list tasks with. // // Deprecated: use [swarm.TaskListOptions]. type TaskListOptions = swarm.TaskListOptions // ServiceCreateOptions contains the options to use when creating a service. // // Deprecated: use [swarm.ServiceCreateOptions]. type ServiceCreateOptions = swarm.ServiceCreateOptions // ServiceUpdateOptions contains the options to be used for updating services. // // Deprecated: use [swarm.ServiceCreateOptions]. type ServiceUpdateOptions = swarm.ServiceUpdateOptions const ( RegistryAuthFromSpec = swarm.RegistryAuthFromSpec // Deprecated: use [swarm.RegistryAuthFromSpec]. RegistryAuthFromPreviousSpec = swarm.RegistryAuthFromPreviousSpec // Deprecated: use [swarm.RegistryAuthFromPreviousSpec]. ) // ServiceListOptions holds parameters to list services with. // // Deprecated: use [swarm.ServiceListOptions]. type ServiceListOptions = swarm.ServiceListOptions // ServiceInspectOptions holds parameters related to the "service inspect" // operation. // // Deprecated: use [swarm.ServiceInspectOptions]. type ServiceInspectOptions = swarm.ServiceInspectOptions // SwarmUnlockKeyResponse contains the response for Engine API: // GET /swarm/unlockkey // // Deprecated: use [swarm.UnlockKeyResponse]. type SwarmUnlockKeyResponse = swarm.UnlockKeyResponse // BuildCache contains information about a build cache record. // // Deprecated: deprecated in API 1.49. Use [build.CacheRecord] instead. type BuildCache = build.CacheRecord // BuildCachePruneOptions hold parameters to prune the build cache // // Deprecated: use [build.CachePruneOptions]. type BuildCachePruneOptions = build.CachePruneOptions // BuildCachePruneReport contains the response for Engine API: // POST "/build/prune" // // Deprecated: use [build.CachePruneReport]. type BuildCachePruneReport = build.CachePruneReport // BuildResult contains the image id of a successful build/ // // Deprecated: use [build.Result]. type BuildResult = build.Result // ImageBuildOptions holds the information // necessary to build images. // // Deprecated: use [build.ImageBuildOptions]. type ImageBuildOptions = build.ImageBuildOptions // ImageBuildOutput defines configuration for exporting a build result // // Deprecated: use [build.ImageBuildOutput]. type ImageBuildOutput = build.ImageBuildOutput // ImageBuildResponse holds information // returned by a server after building // an image. // // Deprecated: use [build.ImageBuildResponse]. type ImageBuildResponse = build.ImageBuildResponse // BuilderVersion sets the version of underlying builder to use // // Deprecated: use [build.BuilderVersion]. type BuilderVersion = build.BuilderVersion const ( // BuilderV1 is the first generation builder in docker daemon // // Deprecated: use [build.BuilderV1]. BuilderV1 = build.BuilderV1 // BuilderBuildKit is builder based on moby/buildkit project // // Deprecated: use [build.BuilderBuildKit]. BuilderBuildKit = build.BuilderBuildKit )
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/plugin_device.go
vendor/github.com/docker/docker/api/types/plugin_device.go
package types // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // PluginDevice plugin device // swagger:model PluginDevice type PluginDevice struct { // description // Required: true Description string `json:"Description"` // name // Required: true Name string `json:"Name"` // path // Required: true Path *string `json:"Path"` // settable // Required: true Settable []string `json:"Settable"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/error_response.go
vendor/github.com/docker/docker/api/types/error_response.go
package types // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // ErrorResponse Represents an error. // swagger:model ErrorResponse type ErrorResponse struct { // The error message. // Required: true Message string `json:"message"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/plugin_mount.go
vendor/github.com/docker/docker/api/types/plugin_mount.go
package types // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // PluginMount plugin mount // swagger:model PluginMount type PluginMount struct { // description // Required: true Description string `json:"Description"` // destination // Required: true Destination string `json:"Destination"` // name // Required: true Name string `json:"Name"` // options // Required: true Options []string `json:"Options"` // settable // Required: true Settable []string `json:"Settable"` // source // Required: true Source *string `json:"Source"` // type // Required: true Type string `json:"Type"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/plugin.go
vendor/github.com/docker/docker/api/types/plugin.go
package types // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // Plugin A plugin for the Engine API // swagger:model Plugin type Plugin struct { // config // Required: true Config PluginConfig `json:"Config"` // True if the plugin is running. False if the plugin is not running, only installed. // Required: true Enabled bool `json:"Enabled"` // Id ID string `json:"Id,omitempty"` // name // Required: true Name string `json:"Name"` // plugin remote reference used to push/pull the plugin PluginReference string `json:"PluginReference,omitempty"` // settings // Required: true Settings PluginSettings `json:"Settings"` } // PluginConfig The config of a plugin. // swagger:model PluginConfig type PluginConfig struct { // args // Required: true Args PluginConfigArgs `json:"Args"` // description // Required: true Description string `json:"Description"` // Docker Version used to create the plugin. // // Depending on how the plugin was created, this field may be empty or omitted. // // Deprecated: this field is no longer set, and will be removed in the next API version. DockerVersion string `json:"DockerVersion,omitempty"` // documentation // Required: true Documentation string `json:"Documentation"` // entrypoint // Required: true Entrypoint []string `json:"Entrypoint"` // env // Required: true Env []PluginEnv `json:"Env"` // interface // Required: true Interface PluginConfigInterface `json:"Interface"` // ipc host // Required: true IpcHost bool `json:"IpcHost"` // linux // Required: true Linux PluginConfigLinux `json:"Linux"` // mounts // Required: true Mounts []PluginMount `json:"Mounts"` // network // Required: true Network PluginConfigNetwork `json:"Network"` // pid host // Required: true PidHost bool `json:"PidHost"` // propagated mount // Required: true PropagatedMount string `json:"PropagatedMount"` // user User PluginConfigUser `json:"User,omitempty"` // work dir // Required: true WorkDir string `json:"WorkDir"` // rootfs Rootfs *PluginConfigRootfs `json:"rootfs,omitempty"` } // PluginConfigArgs plugin config args // swagger:model PluginConfigArgs type PluginConfigArgs struct { // description // Required: true Description string `json:"Description"` // name // Required: true Name string `json:"Name"` // settable // Required: true Settable []string `json:"Settable"` // value // Required: true Value []string `json:"Value"` } // PluginConfigInterface The interface between Docker and the plugin // swagger:model PluginConfigInterface type PluginConfigInterface struct { // Protocol to use for clients connecting to the plugin. ProtocolScheme string `json:"ProtocolScheme,omitempty"` // socket // Required: true Socket string `json:"Socket"` // types // Required: true Types []PluginInterfaceType `json:"Types"` } // PluginConfigLinux plugin config linux // swagger:model PluginConfigLinux type PluginConfigLinux struct { // allow all devices // Required: true AllowAllDevices bool `json:"AllowAllDevices"` // capabilities // Required: true Capabilities []string `json:"Capabilities"` // devices // Required: true Devices []PluginDevice `json:"Devices"` } // PluginConfigNetwork plugin config network // swagger:model PluginConfigNetwork type PluginConfigNetwork struct { // type // Required: true Type string `json:"Type"` } // PluginConfigRootfs plugin config rootfs // swagger:model PluginConfigRootfs type PluginConfigRootfs struct { // diff ids DiffIds []string `json:"diff_ids"` // type Type string `json:"type,omitempty"` } // PluginConfigUser plugin config user // swagger:model PluginConfigUser type PluginConfigUser struct { // g ID GID uint32 `json:"GID,omitempty"` // UID UID uint32 `json:"UID,omitempty"` } // PluginSettings Settings that can be modified by users. // swagger:model PluginSettings type PluginSettings struct { // args // Required: true Args []string `json:"Args"` // devices // Required: true Devices []PluginDevice `json:"Devices"` // env // Required: true Env []string `json:"Env"` // mounts // Required: true Mounts []PluginMount `json:"Mounts"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/storage/driver_data.go
vendor/github.com/docker/docker/api/types/storage/driver_data.go
package storage // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // DriverData Information about the storage driver used to store the container's and // image's filesystem. // // swagger:model DriverData type DriverData struct { // Low-level storage metadata, provided as key/value pairs. // // This information is driver-specific, and depends on the storage-driver // in use, and should be used for informational purposes only. // // Required: true Data map[string]string `json:"Data"` // Name of the storage driver. // Required: true Name string `json:"Name"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/system/security_opts.go
vendor/github.com/docker/docker/api/types/system/security_opts.go
package system import ( "errors" "fmt" "strings" ) // SecurityOpt contains the name and options of a security option type SecurityOpt struct { Name string Options []KeyValue } // DecodeSecurityOptions decodes a security options string slice to a // type-safe [SecurityOpt]. func DecodeSecurityOptions(opts []string) ([]SecurityOpt, error) { so := []SecurityOpt{} for _, opt := range opts { // support output from a < 1.13 docker daemon if !strings.Contains(opt, "=") { so = append(so, SecurityOpt{Name: opt}) continue } secopt := SecurityOpt{} for _, s := range strings.Split(opt, ",") { k, v, ok := strings.Cut(s, "=") if !ok { return nil, fmt.Errorf("invalid security option %q", s) } if k == "" || v == "" { return nil, errors.New("invalid empty security option") } if k == "name" { secopt.Name = v continue } secopt.Options = append(secopt.Options, KeyValue{Key: k, Value: v}) } so = append(so, secopt) } return so, nil } // KeyValue holds a key/value pair. type KeyValue struct { Key, Value string }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/system/runtime.go
vendor/github.com/docker/docker/api/types/system/runtime.go
package system // Runtime describes an OCI runtime type Runtime struct { // "Legacy" runtime configuration for runc-compatible runtimes. Path string `json:"path,omitempty"` Args []string `json:"runtimeArgs,omitempty"` // Shimv2 runtime configuration. Mutually exclusive with the legacy config above. Type string `json:"runtimeType,omitempty"` Options map[string]interface{} `json:"options,omitempty"` } // RuntimeWithStatus extends [Runtime] to hold [RuntimeStatus]. type RuntimeWithStatus struct { Runtime Status map[string]string `json:"status,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/system/info.go
vendor/github.com/docker/docker/api/types/system/info.go
package system import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/registry" "github.com/docker/docker/api/types/swarm" ) // Info contains response of Engine API: // GET "/info" type Info struct { ID string Containers int ContainersRunning int ContainersPaused int ContainersStopped int Images int Driver string DriverStatus [][2]string SystemStatus [][2]string `json:",omitempty"` // SystemStatus is only propagated by the Swarm standalone API Plugins PluginsInfo MemoryLimit bool SwapLimit bool KernelMemory bool `json:",omitempty"` // Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes // KernelMemoryLimit is not supported on cgroups v2. // // Deprecated: This field is deprecated and will be removed in the next release. // Starting with kernel 6.12, the kernel has deprecated kernel memory tcp accounting KernelMemoryTCP bool `json:",omitempty"` // KernelMemoryTCP is not supported on cgroups v2. CPUCfsPeriod bool `json:"CpuCfsPeriod"` CPUCfsQuota bool `json:"CpuCfsQuota"` CPUShares bool CPUSet bool PidsLimit bool IPv4Forwarding bool Debug bool NFd int OomKillDisable bool NGoroutines int SystemTime string LoggingDriver string CgroupDriver string CgroupVersion string `json:",omitempty"` NEventsListener int KernelVersion string OperatingSystem string OSVersion string OSType string Architecture string IndexServerAddress string RegistryConfig *registry.ServiceConfig NCPU int MemTotal int64 GenericResources []swarm.GenericResource DockerRootDir string HTTPProxy string `json:"HttpProxy"` HTTPSProxy string `json:"HttpsProxy"` NoProxy string Name string Labels []string ExperimentalBuild bool ServerVersion string Runtimes map[string]RuntimeWithStatus DefaultRuntime string Swarm swarm.Info // LiveRestoreEnabled determines whether containers should be kept // running when the daemon is shutdown or upon daemon start if // running containers are detected LiveRestoreEnabled bool Isolation container.Isolation InitBinary string ContainerdCommit Commit RuncCommit Commit InitCommit Commit SecurityOptions []string ProductLicense string `json:",omitempty"` DefaultAddressPools []NetworkAddressPool `json:",omitempty"` FirewallBackend *FirewallInfo `json:"FirewallBackend,omitempty"` CDISpecDirs []string DiscoveredDevices []DeviceInfo `json:",omitempty"` Containerd *ContainerdInfo `json:",omitempty"` // Warnings contains a slice of warnings that occurred while collecting // system information. These warnings are intended to be informational // messages for the user, and are not intended to be parsed / used for // other purposes, as they do not have a fixed format. Warnings []string } // ContainerdInfo holds information about the containerd instance used by the daemon. type ContainerdInfo struct { // Address is the path to the containerd socket. Address string `json:",omitempty"` // Namespaces is the containerd namespaces used by the daemon. Namespaces ContainerdNamespaces } // ContainerdNamespaces reflects the containerd namespaces used by the daemon. // // These namespaces can be configured in the daemon configuration, and are // considered to be used exclusively by the daemon, // // As these namespaces are considered to be exclusively accessed // by the daemon, it is not recommended to change these values, // or to change them to a value that is used by other systems, // such as cri-containerd. type ContainerdNamespaces struct { // Containers holds the default containerd namespace used for // containers managed by the daemon. // // The default namespace for containers is "moby", but will be // suffixed with the `<uid>.<gid>` of the remapped `root` if // user-namespaces are enabled and the containerd image-store // is used. Containers string // Plugins holds the default containerd namespace used for // plugins managed by the daemon. // // The default namespace for plugins is "moby", but will be // suffixed with the `<uid>.<gid>` of the remapped `root` if // user-namespaces are enabled and the containerd image-store // is used. Plugins string } // PluginsInfo is a temp struct holding Plugins name // registered with docker daemon. It is used by [Info] struct type PluginsInfo struct { // List of Volume plugins registered Volume []string // List of Network plugins registered Network []string // List of Authorization plugins registered Authorization []string // List of Log plugins registered Log []string } // Commit holds the Git-commit (SHA1) that a binary was built from, as reported // in the version-string of external tools, such as containerd, or runC. type Commit struct { // ID is the actual commit ID or version of external tool. ID string // Expected is the commit ID of external tool expected by dockerd as set at build time. // // Deprecated: this field is no longer used in API v1.49, but kept for backward-compatibility with older API versions. Expected string `json:",omitempty"` } // NetworkAddressPool is a temp struct used by [Info] struct. type NetworkAddressPool struct { Base string Size int } // FirewallInfo describes the firewall backend. type FirewallInfo struct { // Driver is the name of the firewall backend driver. Driver string `json:"Driver"` // Info is a list of label/value pairs, containing information related to the firewall. Info [][2]string `json:"Info,omitempty"` } // DeviceInfo represents a discoverable device from a device driver. type DeviceInfo struct { // Source indicates the origin device driver. Source string `json:"Source"` // ID is the unique identifier for the device. // Example: CDI FQDN like "vendor.com/gpu=0", or other driver-specific device ID ID string `json:"ID"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/image/image_inspect.go
vendor/github.com/docker/docker/api/types/image/image_inspect.go
package image import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/storage" dockerspec "github.com/moby/docker-image-spec/specs-go/v1" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) // RootFS returns Image's RootFS description including the layer IDs. type RootFS struct { Type string `json:",omitempty"` Layers []string `json:",omitempty"` } // InspectResponse contains response of Engine API: // GET "/images/{name:.*}/json" type InspectResponse struct { // ID is the content-addressable ID of an image. // // This identifier is a content-addressable digest calculated from the // image's configuration (which includes the digests of layers used by // the image). // // Note that this digest differs from the `RepoDigests` below, which // holds digests of image manifests that reference the image. ID string `json:"Id"` // RepoTags is a list of image names/tags in the local image cache that // reference this image. // // Multiple image tags can refer to the same image, and this list may be // empty if no tags reference the image, in which case the image is // "untagged", in which case it can still be referenced by its ID. RepoTags []string // RepoDigests is a list of content-addressable digests of locally available // image manifests that the image is referenced from. Multiple manifests can // refer to the same image. // // These digests are usually only available if the image was either pulled // from a registry, or if the image was pushed to a registry, which is when // the manifest is generated and its digest calculated. RepoDigests []string // Parent is the ID of the parent image. // // Depending on how the image was created, this field may be empty and // is only set for images that were built/created locally. This field // is empty if the image was pulled from an image registry. // // Deprecated: this field is deprecated, and will be removed in the next release. Parent string // Comment is an optional message that can be set when committing or // importing the image. Comment string // Created is the date and time at which the image was created, formatted in // RFC 3339 nano-seconds (time.RFC3339Nano). // // This information is only available if present in the image, // and omitted otherwise. Created string `json:",omitempty"` // Container is the ID of the container that was used to create the image. // // Depending on how the image was created, this field may be empty. // // Deprecated: this field is omitted in API v1.45, but kept for backward compatibility. Container string `json:",omitempty"` // ContainerConfig is an optional field containing the configuration of the // container that was last committed when creating the image. // // Previous versions of Docker builder used this field to store build cache, // and it is not in active use anymore. // // Deprecated: this field is omitted in API v1.45, but kept for backward compatibility. ContainerConfig *container.Config `json:",omitempty"` // DockerVersion is the version of Docker that was used to build the image. // // Depending on how the image was created, this field may be empty. // // Deprecated: this field is deprecated, and will be removed in the next release. DockerVersion string // Author is the name of the author that was specified when committing the // image, or as specified through MAINTAINER (deprecated) in the Dockerfile. Author string Config *dockerspec.DockerOCIImageConfig // Architecture is the hardware CPU architecture that the image runs on. Architecture string // Variant is the CPU architecture variant (presently ARM-only). Variant string `json:",omitempty"` // OS is the Operating System the image is built to run on. Os string // OsVersion is the version of the Operating System the image is built to // run on (especially for Windows). OsVersion string `json:",omitempty"` // Size is the total size of the image including all layers it is composed of. Size int64 // VirtualSize is the total size of the image including all layers it is // composed of. // // Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. VirtualSize int64 `json:"VirtualSize,omitempty"` // GraphDriver holds information about the storage driver used to store the // container's and image's filesystem. GraphDriver storage.DriverData // RootFS contains information about the image's RootFS, including the // layer IDs. RootFS RootFS // Metadata of the image in the local cache. // // This information is local to the daemon, and not part of the image itself. Metadata Metadata // Descriptor is the OCI descriptor of the image target. // It's only set if the daemon provides a multi-platform image store. // // WARNING: This is experimental and may change at any time without any backward // compatibility. Descriptor *ocispec.Descriptor `json:"Descriptor,omitempty"` // Manifests is a list of image manifests available in this image. It // provides a more detailed view of the platform-specific image manifests or // other image-attached data like build attestations. // // Only available if the daemon provides a multi-platform image store, the client // requests manifests AND does not request a specific platform. // // WARNING: This is experimental and may change at any time without any backward // compatibility. Manifests []ManifestSummary `json:"Manifests,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/image/image_history.go
vendor/github.com/docker/docker/api/types/image/image_history.go
package image // ---------------------------------------------------------------------------- // Code generated by `swagger generate operation`. DO NOT EDIT. // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- // HistoryResponseItem individual image layer information in response to ImageHistory operation // swagger:model HistoryResponseItem type HistoryResponseItem struct { // comment // Required: true Comment string `json:"Comment"` // created // Required: true Created int64 `json:"Created"` // created by // Required: true CreatedBy string `json:"CreatedBy"` // Id // Required: true ID string `json:"Id"` // size // Required: true Size int64 `json:"Size"` // tags // Required: true Tags []string `json:"Tags"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/image/manifest.go
vendor/github.com/docker/docker/api/types/image/manifest.go
package image import ( "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) type ManifestKind string const ( ManifestKindImage ManifestKind = "image" ManifestKindAttestation ManifestKind = "attestation" ManifestKindUnknown ManifestKind = "unknown" ) type ManifestSummary struct { // ID is the content-addressable ID of an image and is the same as the // digest of the image manifest. // // Required: true ID string `json:"ID"` // Descriptor is the OCI descriptor of the image. // // Required: true Descriptor ocispec.Descriptor `json:"Descriptor"` // Indicates whether all the child content (image config, layers) is // fully available locally // // Required: true Available bool `json:"Available"` // Size is the size information of the content related to this manifest. // Note: These sizes only take the locally available content into account. // // Required: true Size struct { // Content is the size (in bytes) of all the locally present // content in the content store (e.g. image config, layers) // referenced by this manifest and its children. // This only includes blobs in the content store. Content int64 `json:"Content"` // Total is the total size (in bytes) of all the locally present // data (both distributable and non-distributable) that's related to // this manifest and its children. // This equal to the sum of [Content] size AND all the sizes in the // [Size] struct present in the Kind-specific data struct. // For example, for an image kind (Kind == ManifestKindImage), // this would include the size of the image content and unpacked // image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). Total int64 `json:"Total"` } `json:"Size"` // Kind is the kind of the image manifest. // // Required: true Kind ManifestKind `json:"Kind"` // Fields below are specific to the kind of the image manifest. // Present only if Kind == ManifestKindImage. ImageData *ImageProperties `json:"ImageData,omitempty"` // Present only if Kind == ManifestKindAttestation. AttestationData *AttestationProperties `json:"AttestationData,omitempty"` } type ImageProperties struct { // Platform is the OCI platform object describing the platform of the image. // // Required: true Platform ocispec.Platform `json:"Platform"` Size struct { // Unpacked is the size (in bytes) of the locally unpacked // (uncompressed) image content that's directly usable by the containers // running this image. // It's independent of the distributable content - e.g. // the image might still have an unpacked data that's still used by // some container even when the distributable/compressed content is // already gone. // // Required: true Unpacked int64 `json:"Unpacked"` } // Containers is an array containing the IDs of the containers that are // using this image. // // Required: true Containers []string `json:"Containers"` } type AttestationProperties struct { // For is the digest of the image manifest that this attestation is for. For digest.Digest `json:"For"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/image/summary.go
vendor/github.com/docker/docker/api/types/image/summary.go
package image import ocispec "github.com/opencontainers/image-spec/specs-go/v1" type Summary struct { // Number of containers using this image. Includes both stopped and running // containers. // // This size is not calculated by default, and depends on which API endpoint // is used. `-1` indicates that the value has not been set / calculated. // // Required: true Containers int64 `json:"Containers"` // Date and time at which the image was created as a Unix timestamp // (number of seconds since EPOCH). // // Required: true Created int64 `json:"Created"` // ID is the content-addressable ID of an image. // // This identifier is a content-addressable digest calculated from the // image's configuration (which includes the digests of layers used by // the image). // // Note that this digest differs from the `RepoDigests` below, which // holds digests of image manifests that reference the image. // // Required: true ID string `json:"Id"` // User-defined key/value metadata. // Required: true Labels map[string]string `json:"Labels"` // ID of the parent image. // // Depending on how the image was created, this field may be empty and // is only set for images that were built/created locally. This field // is empty if the image was pulled from an image registry. // // Required: true ParentID string `json:"ParentId"` // Descriptor is the OCI descriptor of the image target. // It's only set if the daemon provides a multi-platform image store. // // WARNING: This is experimental and may change at any time without any backward // compatibility. Descriptor *ocispec.Descriptor `json:"Descriptor,omitempty"` // Manifests is a list of image manifests available in this image. It // provides a more detailed view of the platform-specific image manifests or // other image-attached data like build attestations. // // WARNING: This is experimental and may change at any time without any backward // compatibility. Manifests []ManifestSummary `json:"Manifests,omitempty"` // List of content-addressable digests of locally available image manifests // that the image is referenced from. Multiple manifests can refer to the // same image. // // These digests are usually only available if the image was either pulled // from a registry, or if the image was pushed to a registry, which is when // the manifest is generated and its digest calculated. // // Required: true RepoDigests []string `json:"RepoDigests"` // List of image names/tags in the local image cache that reference this // image. // // Multiple image tags can refer to the same image, and this list may be // empty if no tags reference the image, in which case the image is // "untagged", in which case it can still be referenced by its ID. // // Required: true RepoTags []string `json:"RepoTags"` // Total size of image layers that are shared between this image and other // images. // // This size is not calculated by default. `-1` indicates that the value // has not been set / calculated. // // Required: true SharedSize int64 `json:"SharedSize"` // Total size of the image including all layers it is composed of. // // Required: true Size int64 `json:"Size"` // Total size of the image including all layers it is composed of. // // Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. VirtualSize int64 `json:"VirtualSize,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/image/opts.go
vendor/github.com/docker/docker/api/types/image/opts.go
package image import ( "context" "io" "github.com/docker/docker/api/types/filters" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) // ImportSource holds source information for ImageImport type ImportSource struct { Source io.Reader // Source is the data to send to the server to create this image from. You must set SourceName to "-" to leverage this. SourceName string // SourceName is the name of the image to pull. Set to "-" to leverage the Source attribute. } // ImportOptions holds information to import images from the client host. type ImportOptions struct { Tag string // Tag is the name to tag this image with. This attribute is deprecated. Message string // Message is the message to tag the image with Changes []string // Changes are the raw changes to apply to this image Platform string // Platform is the target platform of the image } // CreateOptions holds information to create images. type CreateOptions struct { RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry. Platform string // Platform is the target platform of the image if it needs to be pulled from the registry. } // PullOptions holds information to pull images. type PullOptions struct { All bool RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry // PrivilegeFunc is a function that clients can supply to retry operations // after getting an authorization error. This function returns the registry // authentication header value in base64 encoded format, or an error if the // privilege request fails. // // For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. PrivilegeFunc func(context.Context) (string, error) Platform string } // PushOptions holds information to push images. type PushOptions struct { All bool RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry // PrivilegeFunc is a function that clients can supply to retry operations // after getting an authorization error. This function returns the registry // authentication header value in base64 encoded format, or an error if the // privilege request fails. // // For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. PrivilegeFunc func(context.Context) (string, error) // Platform is an optional field that selects a specific platform to push // when the image is a multi-platform image. // Using this will only push a single platform-specific manifest. Platform *ocispec.Platform `json:",omitempty"` } // ListOptions holds parameters to list images with. type ListOptions struct { // All controls whether all images in the graph are filtered, or just // the heads. All bool // Filters is a JSON-encoded set of filter arguments. Filters filters.Args // SharedSize indicates whether the shared size of images should be computed. SharedSize bool // ContainerCount indicates whether container count should be computed. // // Deprecated: This field has been unused and is no longer required and will be removed in a future version. ContainerCount bool // Manifests indicates whether the image manifests should be returned. Manifests bool } // RemoveOptions holds parameters to remove images. type RemoveOptions struct { Platforms []ocispec.Platform Force bool PruneChildren bool } // HistoryOptions holds parameters to get image history. type HistoryOptions struct { // Platform from the manifest list to use for history. Platform *ocispec.Platform } // LoadOptions holds parameters to load images. type LoadOptions struct { // Quiet suppresses progress output Quiet bool // Platforms selects the platforms to load if the image is a // multi-platform image and has multiple variants. Platforms []ocispec.Platform } type InspectOptions struct { // Manifests returns the image manifests. Manifests bool // Platform selects the specific platform of a multi-platform image to inspect. // // This option is only available for API version 1.49 and up. Platform *ocispec.Platform } // SaveOptions holds parameters to save images. type SaveOptions struct { // Platforms selects the platforms to save if the image is a // multi-platform image and has multiple variants. Platforms []ocispec.Platform }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/image/image.go
vendor/github.com/docker/docker/api/types/image/image.go
package image import ( "io" "time" ) // Metadata contains engine-local data about the image. type Metadata struct { // LastTagTime is the date and time at which the image was last tagged. LastTagTime time.Time `json:",omitempty"` } // PruneReport contains the response for Engine API: // POST "/images/prune" type PruneReport struct { ImagesDeleted []DeleteResponse SpaceReclaimed uint64 } // LoadResponse returns information to the client about a load process. // // TODO(thaJeztah): remove this type, and just use an io.ReadCloser // // This type was added in https://github.com/moby/moby/pull/18878, related // to https://github.com/moby/moby/issues/19177; // // Make docker load to output json when the response content type is json // Swarm hijacks the response from docker load and returns JSON rather // than plain text like the Engine does. This makes the API library to return // information to figure that out. // // However the "load" endpoint unconditionally returns JSON; // https://github.com/moby/moby/blob/7b9d2ef6e5518a3d3f3cc418459f8df786cfbbd1/api/server/router/image/image_routes.go#L248-L255 // // PR https://github.com/moby/moby/pull/21959 made the response-type depend // on whether "quiet" was set, but this logic got changed in a follow-up // https://github.com/moby/moby/pull/25557, which made the JSON response-type // unconditionally, but the output produced depend on whether"quiet" was set. // // We should deprecated the "quiet" option, as it's really a client // responsibility. type LoadResponse struct { // Body must be closed to avoid a resource leak Body io.ReadCloser JSON bool }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/image/disk_usage.go
vendor/github.com/docker/docker/api/types/image/disk_usage.go
package image // DiskUsage contains disk usage for images. // // Deprecated: this type is no longer used and will be removed in the next release. type DiskUsage struct { TotalSize int64 Reclaimable int64 Items []*Summary }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/image/delete_response.go
vendor/github.com/docker/docker/api/types/image/delete_response.go
package image // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // DeleteResponse delete response // swagger:model DeleteResponse type DeleteResponse struct { // The image ID of an image that was deleted Deleted string `json:"Deleted,omitempty"` // The image ID of an image that was untagged Untagged string `json:"Untagged,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/strslice/strslice.go
vendor/github.com/docker/docker/api/types/strslice/strslice.go
package strslice import "encoding/json" // StrSlice represents a string or an array of strings. // We need to override the json decoder to accept both options. type StrSlice []string // UnmarshalJSON decodes the byte slice whether it's a string or an array of // strings. This method is needed to implement json.Unmarshaler. func (e *StrSlice) UnmarshalJSON(b []byte) error { if len(b) == 0 { // With no input, we preserve the existing value by returning nil and // leaving the target alone. This allows defining default values for // the type. return nil } p := make([]string, 0, 1) if err := json.Unmarshal(b, &p); err != nil { var s string if err := json.Unmarshal(b, &s); err != nil { return err } p = append(p, s) } *e = p return nil }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/exec.go
vendor/github.com/docker/docker/api/types/container/exec.go
package container import "github.com/docker/docker/api/types/common" // ExecCreateResponse is the response for a successful exec-create request. // It holds the ID of the exec that was created. // // TODO(thaJeztah): make this a distinct type. type ExecCreateResponse = common.IDResponse // ExecOptions is a small subset of the Config struct that holds the configuration // for the exec feature of docker. type ExecOptions struct { User string // User that will run the command Privileged bool // Is the container in privileged mode Tty bool // Attach standard streams to a tty. ConsoleSize *[2]uint `json:",omitempty"` // Initial console size [height, width] AttachStdin bool // Attach the standard input, makes possible user interaction AttachStderr bool // Attach the standard error AttachStdout bool // Attach the standard output DetachKeys string // Escape keys for detach Env []string // Environment variables WorkingDir string // Working directory Cmd []string // Execution commands and args // Deprecated: the Detach field is not used, and will be removed in a future release. Detach bool } // ExecStartOptions is a temp struct used by execStart // Config fields is part of ExecConfig in runconfig package type ExecStartOptions struct { // ExecStart will first check if it's detached Detach bool // Check if there's a tty Tty bool // Terminal size [height, width], unused if Tty == false ConsoleSize *[2]uint `json:",omitempty"` } // ExecAttachOptions is a temp struct used by execAttach. // // TODO(thaJeztah): make this a separate type; ContainerExecAttach does not use the Detach option, and cannot run detached. type ExecAttachOptions = ExecStartOptions // ExecInspect holds information returned by exec inspect. type ExecInspect struct { ExecID string `json:"ID"` ContainerID string Running bool ExitCode int Pid int }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/health.go
vendor/github.com/docker/docker/api/types/container/health.go
package container import ( "fmt" "strings" "time" ) // HealthStatus is a string representation of the container's health. // // It currently is an alias for string, but may become a distinct type in future. type HealthStatus = string // Health states const ( NoHealthcheck HealthStatus = "none" // Indicates there is no healthcheck Starting HealthStatus = "starting" // Starting indicates that the container is not yet ready Healthy HealthStatus = "healthy" // Healthy indicates that the container is running correctly Unhealthy HealthStatus = "unhealthy" // Unhealthy indicates that the container has a problem ) // Health stores information about the container's healthcheck results type Health struct { Status HealthStatus // Status is one of [Starting], [Healthy] or [Unhealthy]. FailingStreak int // FailingStreak is the number of consecutive failures Log []*HealthcheckResult // Log contains the last few results (oldest first) } // HealthcheckResult stores information about a single run of a healthcheck probe type HealthcheckResult struct { Start time.Time // Start is the time this check started End time.Time // End is the time this check ended ExitCode int // ExitCode meanings: 0=healthy, 1=unhealthy, 2=reserved (considered unhealthy), else=error running probe Output string // Output from last check } var validHealths = []string{ NoHealthcheck, Starting, Healthy, Unhealthy, } // ValidateHealthStatus checks if the provided string is a valid // container [HealthStatus]. func ValidateHealthStatus(s HealthStatus) error { switch s { case NoHealthcheck, Starting, Healthy, Unhealthy: return nil default: return errInvalidParameter{error: fmt.Errorf("invalid value for health (%s): must be one of %s", s, strings.Join(validHealths, ", "))} } }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/create_request.go
vendor/github.com/docker/docker/api/types/container/create_request.go
package container import "github.com/docker/docker/api/types/network" // CreateRequest is the request message sent to the server for container // create calls. It is a config wrapper that holds the container [Config] // (portable) and the corresponding [HostConfig] (non-portable) and // [network.NetworkingConfig]. type CreateRequest struct { *Config HostConfig *HostConfig `json:"HostConfig,omitempty"` NetworkingConfig *network.NetworkingConfig `json:"NetworkingConfig,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/commit.go
vendor/github.com/docker/docker/api/types/container/commit.go
package container import "github.com/docker/docker/api/types/common" // CommitResponse response for the commit API call, containing the ID of the // image that was produced. type CommitResponse = common.IDResponse
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/network_settings.go
vendor/github.com/docker/docker/api/types/container/network_settings.go
package container import ( "github.com/docker/docker/api/types/network" "github.com/docker/go-connections/nat" ) // NetworkSettings exposes the network settings in the api type NetworkSettings struct { NetworkSettingsBase DefaultNetworkSettings Networks map[string]*network.EndpointSettings } // NetworkSettingsBase holds networking state for a container when inspecting it. // // Deprecated: Most fields in NetworkSettingsBase are deprecated. Fields which aren't deprecated will move to // NetworkSettings in v29.0, and this struct will be removed. type NetworkSettingsBase struct { Bridge string // Deprecated: This field is only set when the daemon is started with the --bridge flag specified. SandboxID string // SandboxID uniquely represents a container's network stack SandboxKey string // SandboxKey identifies the sandbox Ports nat.PortMap // Ports is a collection of PortBinding indexed by Port // HairpinMode specifies if hairpin NAT should be enabled on the virtual interface // // Deprecated: This field is never set and will be removed in a future release. HairpinMode bool // LinkLocalIPv6Address is an IPv6 unicast address using the link-local prefix // // Deprecated: This field is never set and will be removed in a future release. LinkLocalIPv6Address string // LinkLocalIPv6PrefixLen is the prefix length of an IPv6 unicast address // // Deprecated: This field is never set and will be removed in a future release. LinkLocalIPv6PrefixLen int SecondaryIPAddresses []network.Address // Deprecated: This field is never set and will be removed in a future release. SecondaryIPv6Addresses []network.Address // Deprecated: This field is never set and will be removed in a future release. } // DefaultNetworkSettings holds the networking state for the default bridge, if the container is connected to that // network. // // Deprecated: this struct is deprecated since Docker v1.11 and will be removed in v29. You should look for the default // network in NetworkSettings.Networks instead. type DefaultNetworkSettings struct { // EndpointID uniquely represents a service endpoint in a Sandbox // // Deprecated: This field will be removed in v29. You should look for the default network in NetworkSettings.Networks instead. EndpointID string // Gateway holds the gateway address for the network // // Deprecated: This field will be removed in v29. You should look for the default network in NetworkSettings.Networks instead. Gateway string // GlobalIPv6Address holds network's global IPv6 address // // Deprecated: This field will be removed in v29. You should look for the default network in NetworkSettings.Networks instead. GlobalIPv6Address string // GlobalIPv6PrefixLen represents mask length of network's global IPv6 address // // Deprecated: This field will be removed in v29. You should look for the default network in NetworkSettings.Networks instead. GlobalIPv6PrefixLen int // IPAddress holds the IPv4 address for the network // // Deprecated: This field will be removed in v29. You should look for the default network in NetworkSettings.Networks instead. IPAddress string // IPPrefixLen represents mask length of network's IPv4 address // // Deprecated: This field will be removed in v29. You should look for the default network in NetworkSettings.Networks instead. IPPrefixLen int // IPv6Gateway holds gateway address specific for IPv6 // // Deprecated: This field will be removed in v29. You should look for the default network in NetworkSettings.Networks instead. IPv6Gateway string // MacAddress holds the MAC address for the network // // Deprecated: This field will be removed in v29. You should look for the default network in NetworkSettings.Networks instead. MacAddress string } // NetworkSettingsSummary provides a summary of container's networks // in /containers/json type NetworkSettingsSummary struct { Networks map[string]*network.EndpointSettings }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/stats.go
vendor/github.com/docker/docker/api/types/container/stats.go
package container import "time" // ThrottlingData stores CPU throttling stats of one running container. // Not used on Windows. type ThrottlingData struct { // Number of periods with throttling active Periods uint64 `json:"periods"` // Number of periods when the container hits its throttling limit. ThrottledPeriods uint64 `json:"throttled_periods"` // Aggregate time the container was throttled for in nanoseconds. ThrottledTime uint64 `json:"throttled_time"` } // CPUUsage stores All CPU stats aggregated since container inception. type CPUUsage struct { // Total CPU time consumed. // Units: nanoseconds (Linux) // Units: 100's of nanoseconds (Windows) TotalUsage uint64 `json:"total_usage"` // Total CPU time consumed per core (Linux). Not used on Windows. // Units: nanoseconds. PercpuUsage []uint64 `json:"percpu_usage,omitempty"` // Time spent by tasks of the cgroup in kernel mode (Linux). // Time spent by all container processes in kernel mode (Windows). // Units: nanoseconds (Linux). // Units: 100's of nanoseconds (Windows). Not populated for Hyper-V Containers. UsageInKernelmode uint64 `json:"usage_in_kernelmode"` // Time spent by tasks of the cgroup in user mode (Linux). // Time spent by all container processes in user mode (Windows). // Units: nanoseconds (Linux). // Units: 100's of nanoseconds (Windows). Not populated for Hyper-V Containers UsageInUsermode uint64 `json:"usage_in_usermode"` } // CPUStats aggregates and wraps all CPU related info of container type CPUStats struct { // CPU Usage. Linux and Windows. CPUUsage CPUUsage `json:"cpu_usage"` // System Usage. Linux only. SystemUsage uint64 `json:"system_cpu_usage,omitempty"` // Online CPUs. Linux only. OnlineCPUs uint32 `json:"online_cpus,omitempty"` // Throttling Data. Linux only. ThrottlingData ThrottlingData `json:"throttling_data,omitempty"` } // MemoryStats aggregates all memory stats since container inception on Linux. // Windows returns stats for commit and private working set only. type MemoryStats struct { // Linux Memory Stats // current res_counter usage for memory Usage uint64 `json:"usage,omitempty"` // maximum usage ever recorded. MaxUsage uint64 `json:"max_usage,omitempty"` // TODO(vishh): Export these as stronger types. // all the stats exported via memory.stat. Stats map[string]uint64 `json:"stats,omitempty"` // number of times memory usage hits limits. Failcnt uint64 `json:"failcnt,omitempty"` Limit uint64 `json:"limit,omitempty"` // Windows Memory Stats // See https://technet.microsoft.com/en-us/magazine/ff382715.aspx // committed bytes Commit uint64 `json:"commitbytes,omitempty"` // peak committed bytes CommitPeak uint64 `json:"commitpeakbytes,omitempty"` // private working set PrivateWorkingSet uint64 `json:"privateworkingset,omitempty"` } // BlkioStatEntry is one small entity to store a piece of Blkio stats // Not used on Windows. type BlkioStatEntry struct { Major uint64 `json:"major"` Minor uint64 `json:"minor"` Op string `json:"op"` Value uint64 `json:"value"` } // BlkioStats stores All IO service stats for data read and write. // This is a Linux specific structure as the differences between expressing // block I/O on Windows and Linux are sufficiently significant to make // little sense attempting to morph into a combined structure. type BlkioStats struct { // number of bytes transferred to and from the block device IoServiceBytesRecursive []BlkioStatEntry `json:"io_service_bytes_recursive"` IoServicedRecursive []BlkioStatEntry `json:"io_serviced_recursive"` IoQueuedRecursive []BlkioStatEntry `json:"io_queue_recursive"` IoServiceTimeRecursive []BlkioStatEntry `json:"io_service_time_recursive"` IoWaitTimeRecursive []BlkioStatEntry `json:"io_wait_time_recursive"` IoMergedRecursive []BlkioStatEntry `json:"io_merged_recursive"` IoTimeRecursive []BlkioStatEntry `json:"io_time_recursive"` SectorsRecursive []BlkioStatEntry `json:"sectors_recursive"` } // StorageStats is the disk I/O stats for read/write on Windows. type StorageStats struct { ReadCountNormalized uint64 `json:"read_count_normalized,omitempty"` ReadSizeBytes uint64 `json:"read_size_bytes,omitempty"` WriteCountNormalized uint64 `json:"write_count_normalized,omitempty"` WriteSizeBytes uint64 `json:"write_size_bytes,omitempty"` } // NetworkStats aggregates the network stats of one container type NetworkStats struct { // Bytes received. Windows and Linux. RxBytes uint64 `json:"rx_bytes"` // Packets received. Windows and Linux. RxPackets uint64 `json:"rx_packets"` // Received errors. Not used on Windows. Note that we don't `omitempty` this // field as it is expected in the >=v1.21 API stats structure. RxErrors uint64 `json:"rx_errors"` // Incoming packets dropped. Windows and Linux. RxDropped uint64 `json:"rx_dropped"` // Bytes sent. Windows and Linux. TxBytes uint64 `json:"tx_bytes"` // Packets sent. Windows and Linux. TxPackets uint64 `json:"tx_packets"` // Sent errors. Not used on Windows. Note that we don't `omitempty` this // field as it is expected in the >=v1.21 API stats structure. TxErrors uint64 `json:"tx_errors"` // Outgoing packets dropped. Windows and Linux. TxDropped uint64 `json:"tx_dropped"` // Endpoint ID. Not used on Linux. EndpointID string `json:"endpoint_id,omitempty"` // Instance ID. Not used on Linux. InstanceID string `json:"instance_id,omitempty"` } // PidsStats contains the stats of a container's pids type PidsStats struct { // Current is the number of pids in the cgroup Current uint64 `json:"current,omitempty"` // Limit is the hard limit on the number of pids in the cgroup. // A "Limit" of 0 means that there is no limit. Limit uint64 `json:"limit,omitempty"` } // Stats is Ultimate struct aggregating all types of stats of one container // // Deprecated: use [StatsResponse] instead. This type will be removed in the next release. type Stats = StatsResponse // StatsResponse aggregates all types of stats of one container. type StatsResponse struct { Name string `json:"name,omitempty"` ID string `json:"id,omitempty"` // Common stats Read time.Time `json:"read"` PreRead time.Time `json:"preread"` // Linux specific stats, not populated on Windows. PidsStats PidsStats `json:"pids_stats,omitempty"` BlkioStats BlkioStats `json:"blkio_stats,omitempty"` // Windows specific stats, not populated on Linux. NumProcs uint32 `json:"num_procs"` StorageStats StorageStats `json:"storage_stats,omitempty"` // Shared stats CPUStats CPUStats `json:"cpu_stats,omitempty"` PreCPUStats CPUStats `json:"precpu_stats,omitempty"` // "Pre"="Previous" MemoryStats MemoryStats `json:"memory_stats,omitempty"` Networks map[string]NetworkStats `json:"networks,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/container.go
vendor/github.com/docker/docker/api/types/container/container.go
package container import ( "io" "os" "time" "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/storage" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) // ContainerUpdateOKBody OK response to ContainerUpdate operation // // Deprecated: use [UpdateResponse]. This alias will be removed in the next release. type ContainerUpdateOKBody = UpdateResponse // ContainerTopOKBody OK response to ContainerTop operation // // Deprecated: use [TopResponse]. This alias will be removed in the next release. type ContainerTopOKBody = TopResponse // PruneReport contains the response for Engine API: // POST "/containers/prune" type PruneReport struct { ContainersDeleted []string SpaceReclaimed uint64 } // PathStat is used to encode the header from // GET "/containers/{name:.*}/archive" // "Name" is the file or directory name. type PathStat struct { Name string `json:"name"` Size int64 `json:"size"` Mode os.FileMode `json:"mode"` Mtime time.Time `json:"mtime"` LinkTarget string `json:"linkTarget"` } // CopyToContainerOptions holds information // about files to copy into a container type CopyToContainerOptions struct { AllowOverwriteDirWithFile bool CopyUIDGID bool } // StatsResponseReader wraps an io.ReadCloser to read (a stream of) stats // for a container, as produced by the GET "/stats" endpoint. // // The OSType field is set to the server's platform to allow // platform-specific handling of the response. // // TODO(thaJeztah): remove this wrapper, and make OSType part of [StatsResponse]. type StatsResponseReader struct { Body io.ReadCloser `json:"body"` OSType string `json:"ostype"` } // MountPoint represents a mount point configuration inside the container. // This is used for reporting the mountpoints in use by a container. type MountPoint struct { // Type is the type of mount, see `Type<foo>` definitions in // github.com/docker/docker/api/types/mount.Type Type mount.Type `json:",omitempty"` // Name is the name reference to the underlying data defined by `Source` // e.g., the volume name. Name string `json:",omitempty"` // Source is the source location of the mount. // // For volumes, this contains the storage location of the volume (within // `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains // the source (host) part of the bind-mount. For `tmpfs` mount points, this // field is empty. Source string // Destination is the path relative to the container root (`/`) where the // Source is mounted inside the container. Destination string // Driver is the volume driver used to create the volume (if it is a volume). Driver string `json:",omitempty"` // Mode is a comma separated list of options supplied by the user when // creating the bind/volume mount. // // The default is platform-specific (`"z"` on Linux, empty on Windows). Mode string // RW indicates whether the mount is mounted writable (read-write). RW bool // Propagation describes how mounts are propagated from the host into the // mount point, and vice-versa. Refer to the Linux kernel documentation // for details: // https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt // // This field is not used on Windows. Propagation mount.Propagation } // State stores container's running state // it's part of ContainerJSONBase and returned by "inspect" command type State struct { Status ContainerState // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead" Running bool Paused bool Restarting bool OOMKilled bool Dead bool Pid int ExitCode int Error string StartedAt string FinishedAt string Health *Health `json:",omitempty"` } // Summary contains response of Engine API: // GET "/containers/json" type Summary struct { ID string `json:"Id"` Names []string Image string ImageID string ImageManifestDescriptor *ocispec.Descriptor `json:"ImageManifestDescriptor,omitempty"` Command string Created int64 Ports []Port SizeRw int64 `json:",omitempty"` SizeRootFs int64 `json:",omitempty"` Labels map[string]string State ContainerState Status string HostConfig struct { NetworkMode string `json:",omitempty"` Annotations map[string]string `json:",omitempty"` } NetworkSettings *NetworkSettingsSummary Mounts []MountPoint } // ContainerJSONBase contains response of Engine API GET "/containers/{name:.*}/json" // for API version 1.18 and older. // // TODO(thaJeztah): combine ContainerJSONBase and InspectResponse into a single struct. // The split between ContainerJSONBase (ContainerJSONBase) and InspectResponse (InspectResponse) // was done in commit 6deaa58ba5f051039643cedceee97c8695e2af74 (https://github.com/moby/moby/pull/13675). // ContainerJSONBase contained all fields for API < 1.19, and InspectResponse // held fields that were added in API 1.19 and up. Given that the minimum // supported API version is now 1.24, we no longer use the separate type. type ContainerJSONBase struct { ID string `json:"Id"` Created string Path string Args []string State *State Image string ResolvConfPath string HostnamePath string HostsPath string LogPath string Name string RestartCount int Driver string Platform string MountLabel string ProcessLabel string AppArmorProfile string ExecIDs []string HostConfig *HostConfig GraphDriver storage.DriverData SizeRw *int64 `json:",omitempty"` SizeRootFs *int64 `json:",omitempty"` } // InspectResponse is the response for the GET "/containers/{name:.*}/json" // endpoint. type InspectResponse struct { *ContainerJSONBase Mounts []MountPoint Config *Config NetworkSettings *NetworkSettings // ImageManifestDescriptor is the descriptor of a platform-specific manifest of the image used to create the container. ImageManifestDescriptor *ocispec.Descriptor `json:"ImageManifestDescriptor,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/errors.go
vendor/github.com/docker/docker/api/types/container/errors.go
package container type errInvalidParameter struct{ error } func (e *errInvalidParameter) InvalidParameter() {} func (e *errInvalidParameter) Unwrap() error { return e.error }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/config.go
vendor/github.com/docker/docker/api/types/container/config.go
package container import ( "time" "github.com/docker/docker/api/types/strslice" "github.com/docker/go-connections/nat" dockerspec "github.com/moby/docker-image-spec/specs-go/v1" ) // MinimumDuration puts a minimum on user configured duration. // This is to prevent API error on time unit. For example, API may // set 3 as healthcheck interval with intention of 3 seconds, but // Docker interprets it as 3 nanoseconds. const MinimumDuration = 1 * time.Millisecond // StopOptions holds the options to stop or restart a container. type StopOptions struct { // Signal (optional) is the signal to send to the container to (gracefully) // stop it before forcibly terminating the container with SIGKILL after the // timeout expires. If not value is set, the default (SIGTERM) is used. Signal string `json:",omitempty"` // Timeout (optional) is the timeout (in seconds) to wait for the container // to stop gracefully before forcibly terminating it with SIGKILL. // // - Use nil to use the default timeout (10 seconds). // - Use '-1' to wait indefinitely. // - Use '0' to not wait for the container to exit gracefully, and // immediately proceeds to forcibly terminating the container. // - Other positive values are used as timeout (in seconds). Timeout *int `json:",omitempty"` } // HealthConfig holds configuration settings for the HEALTHCHECK feature. type HealthConfig = dockerspec.HealthcheckConfig // Config contains the configuration data about a container. // It should hold only portable information about the container. // Here, "portable" means "independent from the host we are running on". // Non-portable information *should* appear in HostConfig. // All fields added to this struct must be marked `omitempty` to keep getting // predictable hashes from the old `v1Compatibility` configuration. type Config struct { Hostname string // Hostname Domainname string // Domainname User string // User that will run the command(s) inside the container, also support user:group AttachStdin bool // Attach the standard input, makes possible user interaction AttachStdout bool // Attach the standard output AttachStderr bool // Attach the standard error ExposedPorts nat.PortSet `json:",omitempty"` // List of exposed ports Tty bool // Attach standard streams to a tty, including stdin if it is not closed. OpenStdin bool // Open stdin StdinOnce bool // If true, close stdin after the 1 attached client disconnects. Env []string // List of environment variable to set in the container Cmd strslice.StrSlice // Command to run when starting the container Healthcheck *HealthConfig `json:",omitempty"` // Healthcheck describes how to check the container is healthy ArgsEscaped bool `json:",omitempty"` // True if command is already escaped (meaning treat as a command line) (Windows specific). Image string // Name of the image as it was passed by the operator (e.g. could be symbolic) Volumes map[string]struct{} // List of volumes (mounts) used for the container WorkingDir string // Current directory (PWD) in the command will be launched Entrypoint strslice.StrSlice // Entrypoint to run when starting the container NetworkDisabled bool `json:",omitempty"` // Is network disabled // Mac Address of the container. // // Deprecated: this field is deprecated since API v1.44. Use EndpointSettings.MacAddress instead. MacAddress string `json:",omitempty"` OnBuild []string // ONBUILD metadata that were defined on the image Dockerfile Labels map[string]string // List of labels set to this container StopSignal string `json:",omitempty"` // Signal to stop a container StopTimeout *int `json:",omitempty"` // Timeout (in seconds) to stop a container Shell strslice.StrSlice `json:",omitempty"` // Shell for shell-form of RUN, CMD, ENTRYPOINT }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/hostconfig_unix.go
vendor/github.com/docker/docker/api/types/container/hostconfig_unix.go
//go:build !windows package container import "github.com/docker/docker/api/types/network" // IsValid indicates if an isolation technology is valid func (i Isolation) IsValid() bool { return i.IsDefault() } // IsBridge indicates whether container uses the bridge network stack func (n NetworkMode) IsBridge() bool { return n == network.NetworkBridge } // IsHost indicates whether container uses the host network stack. func (n NetworkMode) IsHost() bool { return n == network.NetworkHost } // IsUserDefined indicates user-created network func (n NetworkMode) IsUserDefined() bool { return !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() } // NetworkName returns the name of the network stack. func (n NetworkMode) NetworkName() string { switch { case n.IsDefault(): return network.NetworkDefault case n.IsBridge(): return network.NetworkBridge case n.IsHost(): return network.NetworkHost case n.IsNone(): return network.NetworkNone case n.IsContainer(): return "container" case n.IsUserDefined(): return n.UserDefined() default: return "" } }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/port.go
vendor/github.com/docker/docker/api/types/container/port.go
package container // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // Port An open port on a container // swagger:model Port type Port struct { // Host IP address that the container's port is mapped to IP string `json:"IP,omitempty"` // Port on the container // Required: true PrivatePort uint16 `json:"PrivatePort"` // Port exposed on the host PublicPort uint16 `json:"PublicPort,omitempty"` // type // Required: true Type string `json:"Type"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/state.go
vendor/github.com/docker/docker/api/types/container/state.go
package container import ( "fmt" "strings" ) // ContainerState is a string representation of the container's current state. // // It currently is an alias for string, but may become a distinct type in the future. type ContainerState = string const ( StateCreated ContainerState = "created" // StateCreated indicates the container is created, but not (yet) started. StateRunning ContainerState = "running" // StateRunning indicates that the container is running. StatePaused ContainerState = "paused" // StatePaused indicates that the container's current state is paused. StateRestarting ContainerState = "restarting" // StateRestarting indicates that the container is currently restarting. StateRemoving ContainerState = "removing" // StateRemoving indicates that the container is being removed. StateExited ContainerState = "exited" // StateExited indicates that the container exited. StateDead ContainerState = "dead" // StateDead indicates that the container failed to be deleted. Containers in this state are attempted to be cleaned up when the daemon restarts. ) var validStates = []ContainerState{ StateCreated, StateRunning, StatePaused, StateRestarting, StateRemoving, StateExited, StateDead, } // ValidateContainerState checks if the provided string is a valid // container [ContainerState]. func ValidateContainerState(s ContainerState) error { switch s { case StateCreated, StateRunning, StatePaused, StateRestarting, StateRemoving, StateExited, StateDead: return nil default: return errInvalidParameter{error: fmt.Errorf("invalid value for state (%s): must be one of %s", s, strings.Join(validStates, ", "))} } } // StateStatus is used to return container wait results. // Implements exec.ExitCode interface. // This type is needed as State include a sync.Mutex field which make // copying it unsafe. type StateStatus struct { exitCode int err error } // ExitCode returns current exitcode for the state. func (s StateStatus) ExitCode() int { return s.exitCode } // Err returns current error for the state. Returns nil if the container had // exited on its own. func (s StateStatus) Err() error { return s.err } // NewStateStatus returns a new StateStatus with the given exit code and error. func NewStateStatus(exitCode int, err error) StateStatus { return StateStatus{ exitCode: exitCode, err: err, } }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/update_response.go
vendor/github.com/docker/docker/api/types/container/update_response.go
package container // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // UpdateResponse ContainerUpdateResponse // // Response for a successful container-update. // swagger:model UpdateResponse type UpdateResponse struct { // Warnings encountered when updating the container. Warnings []string `json:"Warnings"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/create_response.go
vendor/github.com/docker/docker/api/types/container/create_response.go
package container // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // CreateResponse ContainerCreateResponse // // OK response to ContainerCreate operation // swagger:model CreateResponse type CreateResponse struct { // The ID of the created container // Required: true ID string `json:"Id"` // Warnings encountered when creating the container // Required: true Warnings []string `json:"Warnings"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/change_type.go
vendor/github.com/docker/docker/api/types/container/change_type.go
package container // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // ChangeType Kind of change // // Can be one of: // // - `0`: Modified ("C") // - `1`: Added ("A") // - `2`: Deleted ("D") // // swagger:model ChangeType type ChangeType uint8
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/hostconfig_windows.go
vendor/github.com/docker/docker/api/types/container/hostconfig_windows.go
package container import "github.com/docker/docker/api/types/network" // IsValid indicates if an isolation technology is valid func (i Isolation) IsValid() bool { return i.IsDefault() || i.IsHyperV() || i.IsProcess() } // IsBridge indicates whether container uses the bridge network stack // in windows it is given the name NAT func (n NetworkMode) IsBridge() bool { return n == network.NetworkNat } // IsHost indicates whether container uses the host network stack. // returns false as this is not supported by windows func (n NetworkMode) IsHost() bool { return false } // IsUserDefined indicates user-created network func (n NetworkMode) IsUserDefined() bool { return !n.IsDefault() && !n.IsNone() && !n.IsBridge() && !n.IsContainer() } // NetworkName returns the name of the network stack. func (n NetworkMode) NetworkName() string { switch { case n.IsDefault(): return network.NetworkDefault case n.IsBridge(): return network.NetworkNat case n.IsHost(): // Windows currently doesn't support host network-mode, so // this would currently never happen.. return network.NetworkHost case n.IsNone(): return network.NetworkNone case n.IsContainer(): return "container" case n.IsUserDefined(): return n.UserDefined() default: return "" } }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/disk_usage.go
vendor/github.com/docker/docker/api/types/container/disk_usage.go
package container // DiskUsage contains disk usage for containers. // // Deprecated: this type is no longer used and will be removed in the next release. type DiskUsage struct { TotalSize int64 Reclaimable int64 Items []*Summary }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/change_types.go
vendor/github.com/docker/docker/api/types/container/change_types.go
package container const ( // ChangeModify represents the modify operation. ChangeModify ChangeType = 0 // ChangeAdd represents the add operation. ChangeAdd ChangeType = 1 // ChangeDelete represents the delete operation. ChangeDelete ChangeType = 2 ) func (ct ChangeType) String() string { switch ct { case ChangeModify: return "C" case ChangeAdd: return "A" case ChangeDelete: return "D" default: return "" } }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/top_response.go
vendor/github.com/docker/docker/api/types/container/top_response.go
package container // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // TopResponse ContainerTopResponse // // Container "top" response. // swagger:model TopResponse type TopResponse struct { // Each process running in the container, where each process // is an array of values corresponding to the titles. Processes [][]string `json:"Processes"` // The ps column titles Titles []string `json:"Titles"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/wait_response.go
vendor/github.com/docker/docker/api/types/container/wait_response.go
package container // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // WaitResponse ContainerWaitResponse // // OK response to ContainerWait operation // swagger:model WaitResponse type WaitResponse struct { // error Error *WaitExitError `json:"Error,omitempty"` // Exit code of the container // Required: true StatusCode int64 `json:"StatusCode"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/wait_exit_error.go
vendor/github.com/docker/docker/api/types/container/wait_exit_error.go
package container // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // WaitExitError container waiting error, if any // swagger:model WaitExitError type WaitExitError struct { // Details of an error Message string `json:"Message,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/options.go
vendor/github.com/docker/docker/api/types/container/options.go
package container import "github.com/docker/docker/api/types/filters" // ResizeOptions holds parameters to resize a TTY. // It can be used to resize container TTYs and // exec process TTYs too. type ResizeOptions struct { Height uint Width uint } // AttachOptions holds parameters to attach to a container. type AttachOptions struct { Stream bool Stdin bool Stdout bool Stderr bool DetachKeys string Logs bool } // CommitOptions holds parameters to commit changes into a container. type CommitOptions struct { Reference string Comment string Author string Changes []string Pause bool Config *Config } // RemoveOptions holds parameters to remove containers. type RemoveOptions struct { RemoveVolumes bool RemoveLinks bool Force bool } // StartOptions holds parameters to start containers. type StartOptions struct { CheckpointID string CheckpointDir string } // ListOptions holds parameters to list containers with. type ListOptions struct { Size bool All bool Latest bool Since string Before string Limit int Filters filters.Args } // LogsOptions holds parameters to filter logs with. type LogsOptions struct { ShowStdout bool ShowStderr bool Since string Until string Timestamps bool Follow bool Tail string Details bool }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/filesystem_change.go
vendor/github.com/docker/docker/api/types/container/filesystem_change.go
package container // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // FilesystemChange Change in the container's filesystem. // // swagger:model FilesystemChange type FilesystemChange struct { // kind // Required: true Kind ChangeType `json:"Kind"` // Path to file or directory that has changed. // // Required: true Path string `json:"Path"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/hostconfig.go
vendor/github.com/docker/docker/api/types/container/hostconfig.go
package container import ( "errors" "fmt" "strings" "github.com/docker/docker/api/types/blkiodev" "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/network" "github.com/docker/docker/api/types/strslice" "github.com/docker/go-connections/nat" "github.com/docker/go-units" ) // CgroupnsMode represents the cgroup namespace mode of the container type CgroupnsMode string // cgroup namespace modes for containers const ( CgroupnsModeEmpty CgroupnsMode = "" CgroupnsModePrivate CgroupnsMode = "private" CgroupnsModeHost CgroupnsMode = "host" ) // IsPrivate indicates whether the container uses its own private cgroup namespace func (c CgroupnsMode) IsPrivate() bool { return c == CgroupnsModePrivate } // IsHost indicates whether the container shares the host's cgroup namespace func (c CgroupnsMode) IsHost() bool { return c == CgroupnsModeHost } // IsEmpty indicates whether the container cgroup namespace mode is unset func (c CgroupnsMode) IsEmpty() bool { return c == CgroupnsModeEmpty } // Valid indicates whether the cgroup namespace mode is valid func (c CgroupnsMode) Valid() bool { return c.IsEmpty() || c.IsPrivate() || c.IsHost() } // Isolation represents the isolation technology of a container. The supported // values are platform specific type Isolation string // Isolation modes for containers const ( IsolationEmpty Isolation = "" // IsolationEmpty is unspecified (same behavior as default) IsolationDefault Isolation = "default" // IsolationDefault is the default isolation mode on current daemon IsolationProcess Isolation = "process" // IsolationProcess is process isolation mode IsolationHyperV Isolation = "hyperv" // IsolationHyperV is HyperV isolation mode ) // IsDefault indicates the default isolation technology of a container. On Linux this // is the native driver. On Windows, this is a Windows Server Container. func (i Isolation) IsDefault() bool { // TODO consider making isolation-mode strict (case-sensitive) v := Isolation(strings.ToLower(string(i))) return v == IsolationDefault || v == IsolationEmpty } // IsHyperV indicates the use of a Hyper-V partition for isolation func (i Isolation) IsHyperV() bool { // TODO consider making isolation-mode strict (case-sensitive) return Isolation(strings.ToLower(string(i))) == IsolationHyperV } // IsProcess indicates the use of process isolation func (i Isolation) IsProcess() bool { // TODO consider making isolation-mode strict (case-sensitive) return Isolation(strings.ToLower(string(i))) == IsolationProcess } // IpcMode represents the container ipc stack. type IpcMode string // IpcMode constants const ( IPCModeNone IpcMode = "none" IPCModeHost IpcMode = "host" IPCModeContainer IpcMode = "container" IPCModePrivate IpcMode = "private" IPCModeShareable IpcMode = "shareable" ) // IsPrivate indicates whether the container uses its own private ipc namespace which can not be shared. func (n IpcMode) IsPrivate() bool { return n == IPCModePrivate } // IsHost indicates whether the container shares the host's ipc namespace. func (n IpcMode) IsHost() bool { return n == IPCModeHost } // IsShareable indicates whether the container's ipc namespace can be shared with another container. func (n IpcMode) IsShareable() bool { return n == IPCModeShareable } // IsContainer indicates whether the container uses another container's ipc namespace. func (n IpcMode) IsContainer() bool { _, ok := containerID(string(n)) return ok } // IsNone indicates whether container IpcMode is set to "none". func (n IpcMode) IsNone() bool { return n == IPCModeNone } // IsEmpty indicates whether container IpcMode is empty func (n IpcMode) IsEmpty() bool { return n == "" } // Valid indicates whether the ipc mode is valid. func (n IpcMode) Valid() bool { // TODO(thaJeztah): align with PidMode, and consider container-mode without a container name/ID to be invalid. return n.IsEmpty() || n.IsNone() || n.IsPrivate() || n.IsHost() || n.IsShareable() || n.IsContainer() } // Container returns the name of the container ipc stack is going to be used. func (n IpcMode) Container() (idOrName string) { idOrName, _ = containerID(string(n)) return idOrName } // NetworkMode represents the container network stack. type NetworkMode string // IsNone indicates whether container isn't using a network stack. func (n NetworkMode) IsNone() bool { return n == network.NetworkNone } // IsDefault indicates whether container uses the default network stack. func (n NetworkMode) IsDefault() bool { return n == network.NetworkDefault } // IsPrivate indicates whether container uses its private network stack. func (n NetworkMode) IsPrivate() bool { return !n.IsHost() && !n.IsContainer() } // IsContainer indicates whether container uses a container network stack. func (n NetworkMode) IsContainer() bool { _, ok := containerID(string(n)) return ok } // ConnectedContainer is the id of the container which network this container is connected to. func (n NetworkMode) ConnectedContainer() (idOrName string) { idOrName, _ = containerID(string(n)) return idOrName } // UserDefined indicates user-created network func (n NetworkMode) UserDefined() string { if n.IsUserDefined() { return string(n) } return "" } // UsernsMode represents userns mode in the container. type UsernsMode string // IsHost indicates whether the container uses the host's userns. func (n UsernsMode) IsHost() bool { return n == "host" } // IsPrivate indicates whether the container uses the a private userns. func (n UsernsMode) IsPrivate() bool { return !n.IsHost() } // Valid indicates whether the userns is valid. func (n UsernsMode) Valid() bool { return n == "" || n.IsHost() } // CgroupSpec represents the cgroup to use for the container. type CgroupSpec string // IsContainer indicates whether the container is using another container cgroup func (c CgroupSpec) IsContainer() bool { _, ok := containerID(string(c)) return ok } // Valid indicates whether the cgroup spec is valid. func (c CgroupSpec) Valid() bool { // TODO(thaJeztah): align with PidMode, and consider container-mode without a container name/ID to be invalid. return c == "" || c.IsContainer() } // Container returns the ID or name of the container whose cgroup will be used. func (c CgroupSpec) Container() (idOrName string) { idOrName, _ = containerID(string(c)) return idOrName } // UTSMode represents the UTS namespace of the container. type UTSMode string // IsPrivate indicates whether the container uses its private UTS namespace. func (n UTSMode) IsPrivate() bool { return !n.IsHost() } // IsHost indicates whether the container uses the host's UTS namespace. func (n UTSMode) IsHost() bool { return n == "host" } // Valid indicates whether the UTS namespace is valid. func (n UTSMode) Valid() bool { return n == "" || n.IsHost() } // PidMode represents the pid namespace of the container. type PidMode string // IsPrivate indicates whether the container uses its own new pid namespace. func (n PidMode) IsPrivate() bool { return !n.IsHost() && !n.IsContainer() } // IsHost indicates whether the container uses the host's pid namespace. func (n PidMode) IsHost() bool { return n == "host" } // IsContainer indicates whether the container uses a container's pid namespace. func (n PidMode) IsContainer() bool { _, ok := containerID(string(n)) return ok } // Valid indicates whether the pid namespace is valid. func (n PidMode) Valid() bool { return n == "" || n.IsHost() || validContainer(string(n)) } // Container returns the name of the container whose pid namespace is going to be used. func (n PidMode) Container() (idOrName string) { idOrName, _ = containerID(string(n)) return idOrName } // DeviceRequest represents a request for devices from a device driver. // Used by GPU device drivers. type DeviceRequest struct { Driver string // Name of device driver Count int // Number of devices to request (-1 = All) DeviceIDs []string // List of device IDs as recognizable by the device driver Capabilities [][]string // An OR list of AND lists of device capabilities (e.g. "gpu") Options map[string]string // Options to pass onto the device driver } // DeviceMapping represents the device mapping between the host and the container. type DeviceMapping struct { PathOnHost string PathInContainer string CgroupPermissions string } // RestartPolicy represents the restart policies of the container. type RestartPolicy struct { Name RestartPolicyMode MaximumRetryCount int } type RestartPolicyMode string const ( RestartPolicyDisabled RestartPolicyMode = "no" RestartPolicyAlways RestartPolicyMode = "always" RestartPolicyOnFailure RestartPolicyMode = "on-failure" RestartPolicyUnlessStopped RestartPolicyMode = "unless-stopped" ) // IsNone indicates whether the container has the "no" restart policy. // This means the container will not automatically restart when exiting. func (rp *RestartPolicy) IsNone() bool { return rp.Name == RestartPolicyDisabled || rp.Name == "" } // IsAlways indicates whether the container has the "always" restart policy. // This means the container will automatically restart regardless of the exit status. func (rp *RestartPolicy) IsAlways() bool { return rp.Name == RestartPolicyAlways } // IsOnFailure indicates whether the container has the "on-failure" restart policy. // This means the container will automatically restart of exiting with a non-zero exit status. func (rp *RestartPolicy) IsOnFailure() bool { return rp.Name == RestartPolicyOnFailure } // IsUnlessStopped indicates whether the container has the // "unless-stopped" restart policy. This means the container will // automatically restart unless user has put it to stopped state. func (rp *RestartPolicy) IsUnlessStopped() bool { return rp.Name == RestartPolicyUnlessStopped } // IsSame compares two RestartPolicy to see if they are the same func (rp *RestartPolicy) IsSame(tp *RestartPolicy) bool { return rp.Name == tp.Name && rp.MaximumRetryCount == tp.MaximumRetryCount } // ValidateRestartPolicy validates the given RestartPolicy. func ValidateRestartPolicy(policy RestartPolicy) error { switch policy.Name { case RestartPolicyAlways, RestartPolicyUnlessStopped, RestartPolicyDisabled: if policy.MaximumRetryCount != 0 { msg := "invalid restart policy: maximum retry count can only be used with 'on-failure'" if policy.MaximumRetryCount < 0 { msg += " and cannot be negative" } return &errInvalidParameter{errors.New(msg)} } return nil case RestartPolicyOnFailure: if policy.MaximumRetryCount < 0 { return &errInvalidParameter{errors.New("invalid restart policy: maximum retry count cannot be negative")} } return nil case "": // Versions before v25.0.0 created an empty restart-policy "name" as // default. Allow an empty name with "any" MaximumRetryCount for // backward-compatibility. return nil default: return &errInvalidParameter{fmt.Errorf("invalid restart policy: unknown policy '%s'; use one of '%s', '%s', '%s', or '%s'", policy.Name, RestartPolicyDisabled, RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyUnlessStopped)} } } // LogMode is a type to define the available modes for logging // These modes affect how logs are handled when log messages start piling up. type LogMode string // Available logging modes const ( LogModeUnset LogMode = "" LogModeBlocking LogMode = "blocking" LogModeNonBlock LogMode = "non-blocking" ) // LogConfig represents the logging configuration of the container. type LogConfig struct { Type string Config map[string]string } // Ulimit is an alias for [units.Ulimit], which may be moving to a different // location or become a local type. This alias is to help transitioning. // // Users are recommended to use this alias instead of using [units.Ulimit] directly. type Ulimit = units.Ulimit // Resources contains container's resources (cgroups config, ulimits...) type Resources struct { // Applicable to all platforms CPUShares int64 `json:"CpuShares"` // CPU shares (relative weight vs. other containers) Memory int64 // Memory limit (in bytes) NanoCPUs int64 `json:"NanoCpus"` // CPU quota in units of 10<sup>-9</sup> CPUs. // Applicable to UNIX platforms CgroupParent string // Parent cgroup. BlkioWeight uint16 // Block IO weight (relative weight vs. other containers) BlkioWeightDevice []*blkiodev.WeightDevice BlkioDeviceReadBps []*blkiodev.ThrottleDevice BlkioDeviceWriteBps []*blkiodev.ThrottleDevice BlkioDeviceReadIOps []*blkiodev.ThrottleDevice BlkioDeviceWriteIOps []*blkiodev.ThrottleDevice CPUPeriod int64 `json:"CpuPeriod"` // CPU CFS (Completely Fair Scheduler) period CPUQuota int64 `json:"CpuQuota"` // CPU CFS (Completely Fair Scheduler) quota CPURealtimePeriod int64 `json:"CpuRealtimePeriod"` // CPU real-time period CPURealtimeRuntime int64 `json:"CpuRealtimeRuntime"` // CPU real-time runtime CpusetCpus string // CpusetCpus 0-2, 0,1 CpusetMems string // CpusetMems 0-2, 0,1 Devices []DeviceMapping // List of devices to map inside the container DeviceCgroupRules []string // List of rule to be added to the device cgroup DeviceRequests []DeviceRequest // List of device requests for device drivers // KernelMemory specifies the kernel memory limit (in bytes) for the container. // Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes. KernelMemory int64 `json:",omitempty"` // Hard limit for kernel TCP buffer memory (in bytes). // // Deprecated: This field is deprecated and will be removed in the next release. // Starting with 6.12, the kernel has deprecated kernel memory tcp accounting // for cgroups v1. KernelMemoryTCP int64 `json:",omitempty"` // Hard limit for kernel TCP buffer memory (in bytes) MemoryReservation int64 // Memory soft limit (in bytes) MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap MemorySwappiness *int64 // Tuning container memory swappiness behaviour OomKillDisable *bool // Whether to disable OOM Killer or not PidsLimit *int64 // Setting PIDs limit for a container; Set `0` or `-1` for unlimited, or `null` to not change. Ulimits []*Ulimit // List of ulimits to be set in the container // Applicable to Windows CPUCount int64 `json:"CpuCount"` // CPU count CPUPercent int64 `json:"CpuPercent"` // CPU percent IOMaximumIOps uint64 // Maximum IOps for the container system drive IOMaximumBandwidth uint64 // Maximum IO in bytes per second for the container system drive } // UpdateConfig holds the mutable attributes of a Container. // Those attributes can be updated at runtime. type UpdateConfig struct { // Contains container's resources (cgroups, ulimits) Resources RestartPolicy RestartPolicy } // HostConfig the non-portable Config structure of a container. // Here, "non-portable" means "dependent of the host we are running on". // Portable information *should* appear in Config. type HostConfig struct { // Applicable to all platforms Binds []string // List of volume bindings for this container ContainerIDFile string // File (path) where the containerId is written LogConfig LogConfig // Configuration of the logs for this container NetworkMode NetworkMode // Network mode to use for the container PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host RestartPolicy RestartPolicy // Restart policy to be used for the container AutoRemove bool // Automatically remove container when it exits VolumeDriver string // Name of the volume driver used to mount volumes VolumesFrom []string // List of volumes to take from other container ConsoleSize [2]uint // Initial console size (height,width) Annotations map[string]string `json:",omitempty"` // Arbitrary non-identifying metadata attached to container and provided to the runtime // Applicable to UNIX platforms CapAdd strslice.StrSlice // List of kernel capabilities to add to the container CapDrop strslice.StrSlice // List of kernel capabilities to remove from the container CgroupnsMode CgroupnsMode // Cgroup namespace mode to use for the container DNS []string `json:"Dns"` // List of DNS server to lookup DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for ExtraHosts []string // List of extra hosts GroupAdd []string // List of additional groups that the container process will run as IpcMode IpcMode // IPC namespace to use for the container Cgroup CgroupSpec // Cgroup to use for the container Links []string // List of links (in the name:alias form) OomScoreAdj int // Container preference for OOM-killing PidMode PidMode // PID namespace to use for the container Privileged bool // Is the container in privileged mode PublishAllPorts bool // Should docker publish all exposed port for the container ReadonlyRootfs bool // Is the container root filesystem in read-only SecurityOpt []string // List of string values to customize labels for MLS systems, such as SELinux. StorageOpt map[string]string `json:",omitempty"` // Storage driver options per container. Tmpfs map[string]string `json:",omitempty"` // List of tmpfs (mounts) used for the container UTSMode UTSMode // UTS namespace to use for the container UsernsMode UsernsMode // The user namespace to use for the container ShmSize int64 // Total shm memory usage Sysctls map[string]string `json:",omitempty"` // List of Namespaced sysctls used for the container Runtime string `json:",omitempty"` // Runtime to use with this container // Applicable to Windows Isolation Isolation // Isolation technology of the container (e.g. default, hyperv) // Contains container's resources (cgroups, ulimits) Resources // Mounts specs used by the container Mounts []mount.Mount `json:",omitempty"` // MaskedPaths is the list of paths to be masked inside the container (this overrides the default set of paths) MaskedPaths []string // ReadonlyPaths is the list of paths to be set as read-only inside the container (this overrides the default set of paths) ReadonlyPaths []string // Run a custom init inside the container, if null, use the daemon's configured settings Init *bool `json:",omitempty"` } // containerID splits "container:<ID|name>" values. It returns the container // ID or name, and whether an ID/name was found. It returns an empty string and // a "false" if the value does not have a "container:" prefix. Further validation // of the returned, including checking if the value is empty, should be handled // by the caller. func containerID(val string) (idOrName string, ok bool) { k, v, hasSep := strings.Cut(val, ":") if !hasSep || k != "container" { return "", false } return v, true } // validContainer checks if the given value is a "container:" mode with // a non-empty name/ID. func validContainer(val string) bool { id, ok := containerID(val) return ok && id != "" }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/container/waitcondition.go
vendor/github.com/docker/docker/api/types/container/waitcondition.go
package container // WaitCondition is a type used to specify a container state for which // to wait. type WaitCondition string // Possible WaitCondition Values. // // WaitConditionNotRunning (default) is used to wait for any of the non-running // states: "created", "exited", "dead", "removing", or "removed". // // WaitConditionNextExit is used to wait for the next time the state changes // to a non-running state. If the state is currently "created" or "exited", // this would cause Wait() to block until either the container runs and exits // or is removed. // // WaitConditionRemoved is used to wait for the container to be removed. const ( WaitConditionNotRunning WaitCondition = "not-running" WaitConditionNextExit WaitCondition = "next-exit" WaitConditionRemoved WaitCondition = "removed" )
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/network.go
vendor/github.com/docker/docker/api/types/swarm/network.go
package swarm import ( "github.com/docker/docker/api/types/network" ) // Endpoint represents an endpoint. type Endpoint struct { Spec EndpointSpec `json:",omitempty"` Ports []PortConfig `json:",omitempty"` VirtualIPs []EndpointVirtualIP `json:",omitempty"` } // EndpointSpec represents the spec of an endpoint. type EndpointSpec struct { Mode ResolutionMode `json:",omitempty"` Ports []PortConfig `json:",omitempty"` } // ResolutionMode represents a resolution mode. type ResolutionMode string const ( // ResolutionModeVIP VIP ResolutionModeVIP ResolutionMode = "vip" // ResolutionModeDNSRR DNSRR ResolutionModeDNSRR ResolutionMode = "dnsrr" ) // PortConfig represents the config of a port. type PortConfig struct { Name string `json:",omitempty"` Protocol PortConfigProtocol `json:",omitempty"` // TargetPort is the port inside the container TargetPort uint32 `json:",omitempty"` // PublishedPort is the port on the swarm hosts PublishedPort uint32 `json:",omitempty"` // PublishMode is the mode in which port is published PublishMode PortConfigPublishMode `json:",omitempty"` } // PortConfigPublishMode represents the mode in which the port is to // be published. type PortConfigPublishMode string const ( // PortConfigPublishModeIngress is used for ports published // for ingress load balancing using routing mesh. PortConfigPublishModeIngress PortConfigPublishMode = "ingress" // PortConfigPublishModeHost is used for ports published // for direct host level access on the host where the task is running. PortConfigPublishModeHost PortConfigPublishMode = "host" ) // PortConfigProtocol represents the protocol of a port. type PortConfigProtocol string const ( // TODO(stevvooe): These should be used generally, not just for PortConfig. // PortConfigProtocolTCP TCP PortConfigProtocolTCP PortConfigProtocol = "tcp" // PortConfigProtocolUDP UDP PortConfigProtocolUDP PortConfigProtocol = "udp" // PortConfigProtocolSCTP SCTP PortConfigProtocolSCTP PortConfigProtocol = "sctp" ) // EndpointVirtualIP represents the virtual ip of a port. type EndpointVirtualIP struct { NetworkID string `json:",omitempty"` Addr string `json:",omitempty"` } // Network represents a network. type Network struct { ID string Meta Spec NetworkSpec `json:",omitempty"` DriverState Driver `json:",omitempty"` IPAMOptions *IPAMOptions `json:",omitempty"` } // NetworkSpec represents the spec of a network. type NetworkSpec struct { Annotations DriverConfiguration *Driver `json:",omitempty"` IPv6Enabled bool `json:",omitempty"` Internal bool `json:",omitempty"` Attachable bool `json:",omitempty"` Ingress bool `json:",omitempty"` IPAMOptions *IPAMOptions `json:",omitempty"` ConfigFrom *network.ConfigReference `json:",omitempty"` Scope string `json:",omitempty"` } // NetworkAttachmentConfig represents the configuration of a network attachment. type NetworkAttachmentConfig struct { Target string `json:",omitempty"` Aliases []string `json:",omitempty"` DriverOpts map[string]string `json:",omitempty"` } // NetworkAttachment represents a network attachment. type NetworkAttachment struct { Network Network `json:",omitempty"` Addresses []string `json:",omitempty"` } // IPAMOptions represents ipam options. type IPAMOptions struct { Driver Driver `json:",omitempty"` Configs []IPAMConfig `json:",omitempty"` } // IPAMConfig represents ipam configuration. type IPAMConfig struct { Subnet string `json:",omitempty"` Range string `json:",omitempty"` Gateway string `json:",omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/swarm.go
vendor/github.com/docker/docker/api/types/swarm/swarm.go
package swarm import ( "time" ) // ClusterInfo represents info about the cluster for outputting in "info" // it contains the same information as "Swarm", but without the JoinTokens type ClusterInfo struct { ID string Meta Spec Spec TLSInfo TLSInfo RootRotationInProgress bool DefaultAddrPool []string SubnetSize uint32 DataPathPort uint32 } // Swarm represents a swarm. type Swarm struct { ClusterInfo JoinTokens JoinTokens } // JoinTokens contains the tokens workers and managers need to join the swarm. type JoinTokens struct { // Worker is the join token workers may use to join the swarm. Worker string // Manager is the join token managers may use to join the swarm. Manager string } // Spec represents the spec of a swarm. type Spec struct { Annotations Orchestration OrchestrationConfig `json:",omitempty"` Raft RaftConfig `json:",omitempty"` Dispatcher DispatcherConfig `json:",omitempty"` CAConfig CAConfig `json:",omitempty"` TaskDefaults TaskDefaults `json:",omitempty"` EncryptionConfig EncryptionConfig `json:",omitempty"` } // OrchestrationConfig represents orchestration configuration. type OrchestrationConfig struct { // TaskHistoryRetentionLimit is the number of historic tasks to keep per instance or // node. If negative, never remove completed or failed tasks. TaskHistoryRetentionLimit *int64 `json:",omitempty"` } // TaskDefaults parameterizes cluster-level task creation with default values. type TaskDefaults struct { // LogDriver selects the log driver to use for tasks created in the // orchestrator if unspecified by a service. // // Updating this value will only have an affect on new tasks. Old tasks // will continue use their previously configured log driver until // recreated. LogDriver *Driver `json:",omitempty"` } // EncryptionConfig controls at-rest encryption of data and keys. type EncryptionConfig struct { // AutoLockManagers specifies whether or not managers TLS keys and raft data // should be encrypted at rest in such a way that they must be unlocked // before the manager node starts up again. AutoLockManagers bool } // RaftConfig represents raft configuration. type RaftConfig struct { // SnapshotInterval is the number of log entries between snapshots. SnapshotInterval uint64 `json:",omitempty"` // KeepOldSnapshots is the number of snapshots to keep beyond the // current snapshot. KeepOldSnapshots *uint64 `json:",omitempty"` // LogEntriesForSlowFollowers is the number of log entries to keep // around to sync up slow followers after a snapshot is created. LogEntriesForSlowFollowers uint64 `json:",omitempty"` // ElectionTick is the number of ticks that a follower will wait for a message // from the leader before becoming a candidate and starting an election. // ElectionTick must be greater than HeartbeatTick. // // A tick currently defaults to one second, so these translate directly to // seconds currently, but this is NOT guaranteed. ElectionTick int // HeartbeatTick is the number of ticks between heartbeats. Every // HeartbeatTick ticks, the leader will send a heartbeat to the // followers. // // A tick currently defaults to one second, so these translate directly to // seconds currently, but this is NOT guaranteed. HeartbeatTick int } // DispatcherConfig represents dispatcher configuration. type DispatcherConfig struct { // HeartbeatPeriod defines how often agent should send heartbeats to // dispatcher. HeartbeatPeriod time.Duration `json:",omitempty"` } // CAConfig represents CA configuration. type CAConfig struct { // NodeCertExpiry is the duration certificates should be issued for NodeCertExpiry time.Duration `json:",omitempty"` // ExternalCAs is a list of CAs to which a manager node will make // certificate signing requests for node certificates. ExternalCAs []*ExternalCA `json:",omitempty"` // SigningCACert and SigningCAKey specify the desired signing root CA and // root CA key for the swarm. When inspecting the cluster, the key will // be redacted. SigningCACert string `json:",omitempty"` SigningCAKey string `json:",omitempty"` // If this value changes, and there is no specified signing cert and key, // then the swarm is forced to generate a new root certificate and key. ForceRotate uint64 `json:",omitempty"` } // ExternalCAProtocol represents type of external CA. type ExternalCAProtocol string // ExternalCAProtocolCFSSL CFSSL const ExternalCAProtocolCFSSL ExternalCAProtocol = "cfssl" // ExternalCA defines external CA to be used by the cluster. type ExternalCA struct { // Protocol is the protocol used by this external CA. Protocol ExternalCAProtocol // URL is the URL where the external CA can be reached. URL string // Options is a set of additional key/value pairs whose interpretation // depends on the specified CA type. Options map[string]string `json:",omitempty"` // CACert specifies which root CA is used by this external CA. This certificate must // be in PEM format. CACert string } // InitRequest is the request used to init a swarm. type InitRequest struct { ListenAddr string AdvertiseAddr string DataPathAddr string DataPathPort uint32 ForceNewCluster bool Spec Spec AutoLockManagers bool Availability NodeAvailability DefaultAddrPool []string SubnetSize uint32 } // JoinRequest is the request used to join a swarm. type JoinRequest struct { ListenAddr string AdvertiseAddr string DataPathAddr string RemoteAddrs []string JoinToken string // accept by secret Availability NodeAvailability } // UnlockRequest is the request used to unlock a swarm. type UnlockRequest struct { // UnlockKey is the unlock key in ASCII-armored format. UnlockKey string } // LocalNodeState represents the state of the local node. type LocalNodeState string const ( // LocalNodeStateInactive INACTIVE LocalNodeStateInactive LocalNodeState = "inactive" // LocalNodeStatePending PENDING LocalNodeStatePending LocalNodeState = "pending" // LocalNodeStateActive ACTIVE LocalNodeStateActive LocalNodeState = "active" // LocalNodeStateError ERROR LocalNodeStateError LocalNodeState = "error" // LocalNodeStateLocked LOCKED LocalNodeStateLocked LocalNodeState = "locked" ) // Info represents generic information about swarm. type Info struct { NodeID string NodeAddr string LocalNodeState LocalNodeState ControlAvailable bool Error string RemoteManagers []Peer Nodes int `json:",omitempty"` Managers int `json:",omitempty"` Cluster *ClusterInfo `json:",omitempty"` Warnings []string `json:",omitempty"` } // Status provides information about the current swarm status and role, // obtained from the "Swarm" header in the API response. type Status struct { // NodeState represents the state of the node. NodeState LocalNodeState // ControlAvailable indicates if the node is a swarm manager. ControlAvailable bool } // Peer represents a peer. type Peer struct { NodeID string Addr string } // UpdateFlags contains flags for SwarmUpdate. type UpdateFlags struct { RotateWorkerToken bool RotateManagerToken bool RotateManagerUnlockKey bool } // UnlockKeyResponse contains the response for Engine API: // GET /swarm/unlockkey type UnlockKeyResponse struct { // UnlockKey is the unlock key in ASCII-armored format. UnlockKey string }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/container.go
vendor/github.com/docker/docker/api/types/swarm/container.go
package swarm import ( "time" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/mount" ) // DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf) // Detailed documentation is available in: // http://man7.org/linux/man-pages/man5/resolv.conf.5.html // `nameserver`, `search`, `options` have been supported. // TODO: `domain` is not supported yet. type DNSConfig struct { // Nameservers specifies the IP addresses of the name servers Nameservers []string `json:",omitempty"` // Search specifies the search list for host-name lookup Search []string `json:",omitempty"` // Options allows certain internal resolver variables to be modified Options []string `json:",omitempty"` } // SELinuxContext contains the SELinux labels of the container. type SELinuxContext struct { Disable bool User string Role string Type string Level string } // SeccompMode is the type used for the enumeration of possible seccomp modes // in SeccompOpts type SeccompMode string const ( SeccompModeDefault SeccompMode = "default" SeccompModeUnconfined SeccompMode = "unconfined" SeccompModeCustom SeccompMode = "custom" ) // SeccompOpts defines the options for configuring seccomp on a swarm-managed // container. type SeccompOpts struct { // Mode is the SeccompMode used for the container. Mode SeccompMode `json:",omitempty"` // Profile is the custom seccomp profile as a json object to be used with // the container. Mode should be set to SeccompModeCustom when using a // custom profile in this manner. Profile []byte `json:",omitempty"` } // AppArmorMode is type used for the enumeration of possible AppArmor modes in // AppArmorOpts type AppArmorMode string const ( AppArmorModeDefault AppArmorMode = "default" AppArmorModeDisabled AppArmorMode = "disabled" ) // AppArmorOpts defines the options for configuring AppArmor on a swarm-managed // container. Currently, custom AppArmor profiles are not supported. type AppArmorOpts struct { Mode AppArmorMode `json:",omitempty"` } // CredentialSpec for managed service account (Windows only) type CredentialSpec struct { Config string File string Registry string } // Privileges defines the security options for the container. type Privileges struct { CredentialSpec *CredentialSpec SELinuxContext *SELinuxContext Seccomp *SeccompOpts `json:",omitempty"` AppArmor *AppArmorOpts `json:",omitempty"` NoNewPrivileges bool } // ContainerSpec represents the spec of a container. type ContainerSpec struct { Image string `json:",omitempty"` Labels map[string]string `json:",omitempty"` Command []string `json:",omitempty"` Args []string `json:",omitempty"` Hostname string `json:",omitempty"` Env []string `json:",omitempty"` Dir string `json:",omitempty"` User string `json:",omitempty"` Groups []string `json:",omitempty"` Privileges *Privileges `json:",omitempty"` Init *bool `json:",omitempty"` StopSignal string `json:",omitempty"` TTY bool `json:",omitempty"` OpenStdin bool `json:",omitempty"` ReadOnly bool `json:",omitempty"` Mounts []mount.Mount `json:",omitempty"` StopGracePeriod *time.Duration `json:",omitempty"` Healthcheck *container.HealthConfig `json:",omitempty"` // The format of extra hosts on swarmkit is specified in: // http://man7.org/linux/man-pages/man5/hosts.5.html // IP_address canonical_hostname [aliases...] Hosts []string `json:",omitempty"` DNSConfig *DNSConfig `json:",omitempty"` Secrets []*SecretReference `json:",omitempty"` Configs []*ConfigReference `json:",omitempty"` Isolation container.Isolation `json:",omitempty"` Sysctls map[string]string `json:",omitempty"` CapabilityAdd []string `json:",omitempty"` CapabilityDrop []string `json:",omitempty"` Ulimits []*container.Ulimit `json:",omitempty"` OomScoreAdj int64 `json:",omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/node.go
vendor/github.com/docker/docker/api/types/swarm/node.go
package swarm import "github.com/docker/docker/api/types/filters" // Node represents a node. type Node struct { ID string Meta // Spec defines the desired state of the node as specified by the user. // The system will honor this and will *never* modify it. Spec NodeSpec `json:",omitempty"` // Description encapsulates the properties of the Node as reported by the // agent. Description NodeDescription `json:",omitempty"` // Status provides the current status of the node, as seen by the manager. Status NodeStatus `json:",omitempty"` // ManagerStatus provides the current status of the node's manager // component, if the node is a manager. ManagerStatus *ManagerStatus `json:",omitempty"` } // NodeSpec represents the spec of a node. type NodeSpec struct { Annotations Role NodeRole `json:",omitempty"` Availability NodeAvailability `json:",omitempty"` } // NodeRole represents the role of a node. type NodeRole string const ( // NodeRoleWorker WORKER NodeRoleWorker NodeRole = "worker" // NodeRoleManager MANAGER NodeRoleManager NodeRole = "manager" ) // NodeAvailability represents the availability of a node. type NodeAvailability string const ( // NodeAvailabilityActive ACTIVE NodeAvailabilityActive NodeAvailability = "active" // NodeAvailabilityPause PAUSE NodeAvailabilityPause NodeAvailability = "pause" // NodeAvailabilityDrain DRAIN NodeAvailabilityDrain NodeAvailability = "drain" ) // NodeDescription represents the description of a node. type NodeDescription struct { Hostname string `json:",omitempty"` Platform Platform `json:",omitempty"` Resources Resources `json:",omitempty"` Engine EngineDescription `json:",omitempty"` TLSInfo TLSInfo `json:",omitempty"` CSIInfo []NodeCSIInfo `json:",omitempty"` } // Platform represents the platform (Arch/OS). type Platform struct { Architecture string `json:",omitempty"` OS string `json:",omitempty"` } // EngineDescription represents the description of an engine. type EngineDescription struct { EngineVersion string `json:",omitempty"` Labels map[string]string `json:",omitempty"` Plugins []PluginDescription `json:",omitempty"` } // NodeCSIInfo represents information about a CSI plugin available on the node type NodeCSIInfo struct { // PluginName is the name of the CSI plugin. PluginName string `json:",omitempty"` // NodeID is the ID of the node as reported by the CSI plugin. This is // different from the swarm node ID. NodeID string `json:",omitempty"` // MaxVolumesPerNode is the maximum number of volumes that may be published // to this node MaxVolumesPerNode int64 `json:",omitempty"` // AccessibleTopology indicates the location of this node in the CSI // plugin's topology AccessibleTopology *Topology `json:",omitempty"` } // PluginDescription represents the description of an engine plugin. type PluginDescription struct { Type string `json:",omitempty"` Name string `json:",omitempty"` } // NodeStatus represents the status of a node. type NodeStatus struct { State NodeState `json:",omitempty"` Message string `json:",omitempty"` Addr string `json:",omitempty"` } // Reachability represents the reachability of a node. type Reachability string const ( // ReachabilityUnknown UNKNOWN ReachabilityUnknown Reachability = "unknown" // ReachabilityUnreachable UNREACHABLE ReachabilityUnreachable Reachability = "unreachable" // ReachabilityReachable REACHABLE ReachabilityReachable Reachability = "reachable" ) // ManagerStatus represents the status of a manager. type ManagerStatus struct { Leader bool `json:",omitempty"` Reachability Reachability `json:",omitempty"` Addr string `json:",omitempty"` } // NodeState represents the state of a node. type NodeState string const ( // NodeStateUnknown UNKNOWN NodeStateUnknown NodeState = "unknown" // NodeStateDown DOWN NodeStateDown NodeState = "down" // NodeStateReady READY NodeStateReady NodeState = "ready" // NodeStateDisconnected DISCONNECTED NodeStateDisconnected NodeState = "disconnected" ) // Topology defines the CSI topology of this node. This type is a duplicate of // github.com/docker/docker/api/types.Topology. Because the type definition // is so simple and to avoid complicated structure or circular imports, we just // duplicate it here. See that type for full documentation type Topology struct { Segments map[string]string `json:",omitempty"` } // NodeListOptions holds parameters to list nodes with. type NodeListOptions struct { Filters filters.Args } // NodeRemoveOptions holds parameters to remove nodes with. type NodeRemoveOptions struct { Force bool }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/service.go
vendor/github.com/docker/docker/api/types/swarm/service.go
package swarm import ( "time" "github.com/docker/docker/api/types/filters" ) // Service represents a service. type Service struct { ID string Meta Spec ServiceSpec `json:",omitempty"` PreviousSpec *ServiceSpec `json:",omitempty"` Endpoint Endpoint `json:",omitempty"` UpdateStatus *UpdateStatus `json:",omitempty"` // ServiceStatus is an optional, extra field indicating the number of // desired and running tasks. It is provided primarily as a shortcut to // calculating these values client-side, which otherwise would require // listing all tasks for a service, an operation that could be // computation and network expensive. ServiceStatus *ServiceStatus `json:",omitempty"` // JobStatus is the status of a Service which is in one of ReplicatedJob or // GlobalJob modes. It is absent on Replicated and Global services. JobStatus *JobStatus `json:",omitempty"` } // ServiceSpec represents the spec of a service. type ServiceSpec struct { Annotations // TaskTemplate defines how the service should construct new tasks when // orchestrating this service. TaskTemplate TaskSpec `json:",omitempty"` Mode ServiceMode `json:",omitempty"` UpdateConfig *UpdateConfig `json:",omitempty"` RollbackConfig *UpdateConfig `json:",omitempty"` // Networks specifies which networks the service should attach to. // // Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. Networks []NetworkAttachmentConfig `json:",omitempty"` EndpointSpec *EndpointSpec `json:",omitempty"` } // ServiceMode represents the mode of a service. type ServiceMode struct { Replicated *ReplicatedService `json:",omitempty"` Global *GlobalService `json:",omitempty"` ReplicatedJob *ReplicatedJob `json:",omitempty"` GlobalJob *GlobalJob `json:",omitempty"` } // UpdateState is the state of a service update. type UpdateState string const ( // UpdateStateUpdating is the updating state. UpdateStateUpdating UpdateState = "updating" // UpdateStatePaused is the paused state. UpdateStatePaused UpdateState = "paused" // UpdateStateCompleted is the completed state. UpdateStateCompleted UpdateState = "completed" // UpdateStateRollbackStarted is the state with a rollback in progress. UpdateStateRollbackStarted UpdateState = "rollback_started" // UpdateStateRollbackPaused is the state with a rollback in progress. UpdateStateRollbackPaused UpdateState = "rollback_paused" // UpdateStateRollbackCompleted is the state with a rollback in progress. UpdateStateRollbackCompleted UpdateState = "rollback_completed" ) // UpdateStatus reports the status of a service update. type UpdateStatus struct { State UpdateState `json:",omitempty"` StartedAt *time.Time `json:",omitempty"` CompletedAt *time.Time `json:",omitempty"` Message string `json:",omitempty"` } // ReplicatedService is a kind of ServiceMode. type ReplicatedService struct { Replicas *uint64 `json:",omitempty"` } // GlobalService is a kind of ServiceMode. type GlobalService struct{} // ReplicatedJob is the a type of Service which executes a defined Tasks // in parallel until the specified number of Tasks have succeeded. type ReplicatedJob struct { // MaxConcurrent indicates the maximum number of Tasks that should be // executing simultaneously for this job at any given time. There may be // fewer Tasks that MaxConcurrent executing simultaneously; for example, if // there are fewer than MaxConcurrent tasks needed to reach // TotalCompletions. // // If this field is empty, it will default to a max concurrency of 1. MaxConcurrent *uint64 `json:",omitempty"` // TotalCompletions is the total number of Tasks desired to run to // completion. // // If this field is empty, the value of MaxConcurrent will be used. TotalCompletions *uint64 `json:",omitempty"` } // GlobalJob is the type of a Service which executes a Task on every Node // matching the Service's placement constraints. These tasks run to completion // and then exit. // // This type is deliberately empty. type GlobalJob struct{} const ( // UpdateFailureActionPause PAUSE UpdateFailureActionPause = "pause" // UpdateFailureActionContinue CONTINUE UpdateFailureActionContinue = "continue" // UpdateFailureActionRollback ROLLBACK UpdateFailureActionRollback = "rollback" // UpdateOrderStopFirst STOP_FIRST UpdateOrderStopFirst = "stop-first" // UpdateOrderStartFirst START_FIRST UpdateOrderStartFirst = "start-first" ) // UpdateConfig represents the update configuration. type UpdateConfig struct { // Maximum number of tasks to be updated in one iteration. // 0 means unlimited parallelism. Parallelism uint64 // Amount of time between updates. Delay time.Duration `json:",omitempty"` // FailureAction is the action to take when an update failures. FailureAction string `json:",omitempty"` // Monitor indicates how long to monitor a task for failure after it is // created. If the task fails by ending up in one of the states // REJECTED, COMPLETED, or FAILED, within Monitor from its creation, // this counts as a failure. If it fails after Monitor, it does not // count as a failure. If Monitor is unspecified, a default value will // be used. Monitor time.Duration `json:",omitempty"` // MaxFailureRatio is the fraction of tasks that may fail during // an update before the failure action is invoked. Any task created by // the current update which ends up in one of the states REJECTED, // COMPLETED or FAILED within Monitor from its creation counts as a // failure. The number of failures is divided by the number of tasks // being updated, and if this fraction is greater than // MaxFailureRatio, the failure action is invoked. // // If the failure action is CONTINUE, there is no effect. // If the failure action is PAUSE, no more tasks will be updated until // another update is started. MaxFailureRatio float32 // Order indicates the order of operations when rolling out an updated // task. Either the old task is shut down before the new task is // started, or the new task is started before the old task is shut down. Order string } // ServiceStatus represents the number of running tasks in a service and the // number of tasks desired to be running. type ServiceStatus struct { // RunningTasks is the number of tasks for the service actually in the // Running state RunningTasks uint64 // DesiredTasks is the number of tasks desired to be running by the // service. For replicated services, this is the replica count. For global // services, this is computed by taking the number of tasks with desired // state of not-Shutdown. DesiredTasks uint64 // CompletedTasks is the number of tasks in the state Completed, if this // service is in ReplicatedJob or GlobalJob mode. This field must be // cross-referenced with the service type, because the default value of 0 // may mean that a service is not in a job mode, or it may mean that the // job has yet to complete any tasks. CompletedTasks uint64 } // JobStatus is the status of a job-type service. type JobStatus struct { // JobIteration is a value increased each time a Job is executed, // successfully or otherwise. "Executed", in this case, means the job as a // whole has been started, not that an individual Task has been launched. A // job is "Executed" when its ServiceSpec is updated. JobIteration can be // used to disambiguate Tasks belonging to different executions of a job. // // Though JobIteration will increase with each subsequent execution, it may // not necessarily increase by 1, and so JobIteration should not be used to // keep track of the number of times a job has been executed. JobIteration Version // LastExecution is the time that the job was last executed, as observed by // Swarm manager. LastExecution time.Time `json:",omitempty"` } // ServiceCreateOptions contains the options to use when creating a service. type ServiceCreateOptions struct { // EncodedRegistryAuth is the encoded registry authorization credentials to // use when updating the service. // // This field follows the format of the X-Registry-Auth header. EncodedRegistryAuth string // QueryRegistry indicates whether the service update requires // contacting a registry. A registry may be contacted to retrieve // the image digest and manifest, which in turn can be used to update // platform or other information about the service. QueryRegistry bool } // Values for RegistryAuthFrom in ServiceUpdateOptions const ( RegistryAuthFromSpec = "spec" RegistryAuthFromPreviousSpec = "previous-spec" ) // ServiceUpdateOptions contains the options to be used for updating services. type ServiceUpdateOptions struct { // EncodedRegistryAuth is the encoded registry authorization credentials to // use when updating the service. // // This field follows the format of the X-Registry-Auth header. EncodedRegistryAuth string // TODO(stevvooe): Consider moving the version parameter of ServiceUpdate // into this field. While it does open API users up to racy writes, most // users may not need that level of consistency in practice. // RegistryAuthFrom specifies where to find the registry authorization // credentials if they are not given in EncodedRegistryAuth. Valid // values are "spec" and "previous-spec". RegistryAuthFrom string // Rollback indicates whether a server-side rollback should be // performed. When this is set, the provided spec will be ignored. // The valid values are "previous" and "none". An empty value is the // same as "none". Rollback string // QueryRegistry indicates whether the service update requires // contacting a registry. A registry may be contacted to retrieve // the image digest and manifest, which in turn can be used to update // platform or other information about the service. QueryRegistry bool } // ServiceListOptions holds parameters to list services with. type ServiceListOptions struct { Filters filters.Args // Status indicates whether the server should include the service task // count of running and desired tasks. Status bool } // ServiceInspectOptions holds parameters related to the "service inspect" // operation. type ServiceInspectOptions struct { InsertDefaults bool }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/config.go
vendor/github.com/docker/docker/api/types/swarm/config.go
package swarm import ( "os" "github.com/docker/docker/api/types/filters" ) // Config represents a config. type Config struct { ID string Meta Spec ConfigSpec } // ConfigSpec represents a config specification from a config in swarm type ConfigSpec struct { Annotations // Data is the data to store as a config. // // The maximum allowed size is 1000KB, as defined in [MaxConfigSize]. // // [MaxConfigSize]: https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize Data []byte `json:",omitempty"` // Templating controls whether and how to evaluate the config payload as // a template. If it is not set, no templating is used. Templating *Driver `json:",omitempty"` } // ConfigReferenceFileTarget is a file target in a config reference type ConfigReferenceFileTarget struct { Name string UID string GID string Mode os.FileMode } // ConfigReferenceRuntimeTarget is a target for a config specifying that it // isn't mounted into the container but instead has some other purpose. type ConfigReferenceRuntimeTarget struct{} // ConfigReference is a reference to a config in swarm type ConfigReference struct { File *ConfigReferenceFileTarget `json:",omitempty"` Runtime *ConfigReferenceRuntimeTarget `json:",omitempty"` ConfigID string ConfigName string } // ConfigCreateResponse contains the information returned to a client // on the creation of a new config. type ConfigCreateResponse struct { // ID is the id of the created config. ID string } // ConfigListOptions holds parameters to list configs type ConfigListOptions struct { Filters filters.Args }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/secret.go
vendor/github.com/docker/docker/api/types/swarm/secret.go
package swarm import ( "os" "github.com/docker/docker/api/types/filters" ) // Secret represents a secret. type Secret struct { ID string Meta Spec SecretSpec } // SecretSpec represents a secret specification from a secret in swarm type SecretSpec struct { Annotations // Data is the data to store as a secret. It must be empty if a // [Driver] is used, in which case the data is loaded from an external // secret store. The maximum allowed size is 500KB, as defined in // [MaxSecretSize]. // // This field is only used to create the secret, and is not returned // by other endpoints. // // [MaxSecretSize]: https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize Data []byte `json:",omitempty"` // Driver is the name of the secrets driver used to fetch the secret's // value from an external secret store. If not set, the default built-in // store is used. Driver *Driver `json:",omitempty"` // Templating controls whether and how to evaluate the secret payload as // a template. If it is not set, no templating is used. Templating *Driver `json:",omitempty"` } // SecretReferenceFileTarget is a file target in a secret reference type SecretReferenceFileTarget struct { Name string UID string GID string Mode os.FileMode } // SecretReference is a reference to a secret in swarm type SecretReference struct { File *SecretReferenceFileTarget SecretID string SecretName string } // SecretCreateResponse contains the information returned to a client // on the creation of a new secret. type SecretCreateResponse struct { // ID is the id of the created secret. ID string } // SecretListOptions holds parameters to list secrets type SecretListOptions struct { Filters filters.Args }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/task.go
vendor/github.com/docker/docker/api/types/swarm/task.go
package swarm import ( "time" "github.com/docker/docker/api/types/filters" ) // TaskState represents the state of a task. type TaskState string const ( // TaskStateNew NEW TaskStateNew TaskState = "new" // TaskStateAllocated ALLOCATED TaskStateAllocated TaskState = "allocated" // TaskStatePending PENDING TaskStatePending TaskState = "pending" // TaskStateAssigned ASSIGNED TaskStateAssigned TaskState = "assigned" // TaskStateAccepted ACCEPTED TaskStateAccepted TaskState = "accepted" // TaskStatePreparing PREPARING TaskStatePreparing TaskState = "preparing" // TaskStateReady READY TaskStateReady TaskState = "ready" // TaskStateStarting STARTING TaskStateStarting TaskState = "starting" // TaskStateRunning RUNNING TaskStateRunning TaskState = "running" // TaskStateComplete COMPLETE TaskStateComplete TaskState = "complete" // TaskStateShutdown SHUTDOWN TaskStateShutdown TaskState = "shutdown" // TaskStateFailed FAILED TaskStateFailed TaskState = "failed" // TaskStateRejected REJECTED TaskStateRejected TaskState = "rejected" // TaskStateRemove REMOVE TaskStateRemove TaskState = "remove" // TaskStateOrphaned ORPHANED TaskStateOrphaned TaskState = "orphaned" ) // Task represents a task. type Task struct { ID string Meta Annotations Spec TaskSpec `json:",omitempty"` ServiceID string `json:",omitempty"` Slot int `json:",omitempty"` NodeID string `json:",omitempty"` Status TaskStatus `json:",omitempty"` DesiredState TaskState `json:",omitempty"` NetworksAttachments []NetworkAttachment `json:",omitempty"` GenericResources []GenericResource `json:",omitempty"` // JobIteration is the JobIteration of the Service that this Task was // spawned from, if the Service is a ReplicatedJob or GlobalJob. This is // used to determine which Tasks belong to which run of the job. This field // is absent if the Service mode is Replicated or Global. JobIteration *Version `json:",omitempty"` // Volumes is the list of VolumeAttachments for this task. It specifies // which particular volumes are to be used by this particular task, and // fulfilling what mounts in the spec. Volumes []VolumeAttachment } // TaskSpec represents the spec of a task. type TaskSpec struct { // ContainerSpec, NetworkAttachmentSpec, and PluginSpec are mutually exclusive. // PluginSpec is only used when the `Runtime` field is set to `plugin` // NetworkAttachmentSpec is used if the `Runtime` field is set to // `attachment`. ContainerSpec *ContainerSpec `json:",omitempty"` PluginSpec *RuntimeSpec `json:",omitempty"` NetworkAttachmentSpec *NetworkAttachmentSpec `json:",omitempty"` Resources *ResourceRequirements `json:",omitempty"` RestartPolicy *RestartPolicy `json:",omitempty"` Placement *Placement `json:",omitempty"` Networks []NetworkAttachmentConfig `json:",omitempty"` // LogDriver specifies the LogDriver to use for tasks created from this // spec. If not present, the one on cluster default on swarm.Spec will be // used, finally falling back to the engine default if not specified. LogDriver *Driver `json:",omitempty"` // ForceUpdate is a counter that triggers an update even if no relevant // parameters have been changed. ForceUpdate uint64 Runtime RuntimeType `json:",omitempty"` } // Resources represents resources (CPU/Memory) which can be advertised by a // node and requested to be reserved for a task. type Resources struct { NanoCPUs int64 `json:",omitempty"` MemoryBytes int64 `json:",omitempty"` GenericResources []GenericResource `json:",omitempty"` } // Limit describes limits on resources which can be requested by a task. type Limit struct { NanoCPUs int64 `json:",omitempty"` MemoryBytes int64 `json:",omitempty"` Pids int64 `json:",omitempty"` } // GenericResource represents a "user defined" resource which can // be either an integer (e.g: SSD=3) or a string (e.g: SSD=sda1) type GenericResource struct { NamedResourceSpec *NamedGenericResource `json:",omitempty"` DiscreteResourceSpec *DiscreteGenericResource `json:",omitempty"` } // NamedGenericResource represents a "user defined" resource which is defined // as a string. // "Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...) // Value is used to identify the resource (GPU="UUID-1", FPGA="/dev/sdb5", ...) type NamedGenericResource struct { Kind string `json:",omitempty"` Value string `json:",omitempty"` } // DiscreteGenericResource represents a "user defined" resource which is defined // as an integer // "Kind" is used to describe the Kind of a resource (e.g: "GPU", "FPGA", "SSD", ...) // Value is used to count the resource (SSD=5, HDD=3, ...) type DiscreteGenericResource struct { Kind string `json:",omitempty"` Value int64 `json:",omitempty"` } // ResourceRequirements represents resources requirements. type ResourceRequirements struct { Limits *Limit `json:",omitempty"` Reservations *Resources `json:",omitempty"` } // Placement represents orchestration parameters. type Placement struct { Constraints []string `json:",omitempty"` Preferences []PlacementPreference `json:",omitempty"` MaxReplicas uint64 `json:",omitempty"` // Platforms stores all the platforms that the image can run on. // This field is used in the platform filter for scheduling. If empty, // then the platform filter is off, meaning there are no scheduling restrictions. Platforms []Platform `json:",omitempty"` } // PlacementPreference provides a way to make the scheduler aware of factors // such as topology. type PlacementPreference struct { Spread *SpreadOver } // SpreadOver is a scheduling preference that instructs the scheduler to spread // tasks evenly over groups of nodes identified by labels. type SpreadOver struct { // label descriptor, such as engine.labels.az SpreadDescriptor string } // RestartPolicy represents the restart policy. type RestartPolicy struct { Condition RestartPolicyCondition `json:",omitempty"` Delay *time.Duration `json:",omitempty"` MaxAttempts *uint64 `json:",omitempty"` Window *time.Duration `json:",omitempty"` } // RestartPolicyCondition represents when to restart. type RestartPolicyCondition string const ( // RestartPolicyConditionNone NONE RestartPolicyConditionNone RestartPolicyCondition = "none" // RestartPolicyConditionOnFailure ON_FAILURE RestartPolicyConditionOnFailure RestartPolicyCondition = "on-failure" // RestartPolicyConditionAny ANY RestartPolicyConditionAny RestartPolicyCondition = "any" ) // TaskStatus represents the status of a task. type TaskStatus struct { Timestamp time.Time `json:",omitempty"` State TaskState `json:",omitempty"` Message string `json:",omitempty"` Err string `json:",omitempty"` ContainerStatus *ContainerStatus `json:",omitempty"` PortStatus PortStatus `json:",omitempty"` } // ContainerStatus represents the status of a container. type ContainerStatus struct { ContainerID string PID int ExitCode int } // PortStatus represents the port status of a task's host ports whose // service has published host ports type PortStatus struct { Ports []PortConfig `json:",omitempty"` } // VolumeAttachment contains the associating a Volume to a Task. type VolumeAttachment struct { // ID is the Swarmkit ID of the Volume. This is not the CSI VolumeId. ID string `json:",omitempty"` // Source, together with Target, indicates the Mount, as specified in the // ContainerSpec, that this volume fulfills. Source string `json:",omitempty"` // Target, together with Source, indicates the Mount, as specified // in the ContainerSpec, that this volume fulfills. Target string `json:",omitempty"` } // TaskListOptions holds parameters to list tasks with. type TaskListOptions struct { Filters filters.Args }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/service_create_response.go
vendor/github.com/docker/docker/api/types/swarm/service_create_response.go
package swarm // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // ServiceCreateResponse contains the information returned to a client on the // creation of a new service. // // swagger:model ServiceCreateResponse type ServiceCreateResponse struct { // The ID of the created service. ID string `json:"ID,omitempty"` // Optional warning message. // // FIXME(thaJeztah): this should have "omitempty" in the generated type. // Warnings []string `json:"Warnings"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/service_update_response.go
vendor/github.com/docker/docker/api/types/swarm/service_update_response.go
package swarm // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // ServiceUpdateResponse service update response // swagger:model ServiceUpdateResponse type ServiceUpdateResponse struct { // Optional warning messages Warnings []string `json:"Warnings"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/runtime.go
vendor/github.com/docker/docker/api/types/swarm/runtime.go
package swarm import "github.com/docker/docker/api/types/swarm/runtime" // RuntimeType is the type of runtime used for the TaskSpec type RuntimeType string // RuntimeURL is the proto type url type RuntimeURL string const ( // RuntimeContainer is the container based runtime RuntimeContainer RuntimeType = "container" // RuntimePlugin is the plugin based runtime RuntimePlugin RuntimeType = "plugin" // RuntimeNetworkAttachment is the network attachment runtime RuntimeNetworkAttachment RuntimeType = "attachment" // RuntimeURLContainer is the proto url for the container type RuntimeURLContainer RuntimeURL = "types.docker.com/RuntimeContainer" // RuntimeURLPlugin is the proto url for the plugin type RuntimeURLPlugin RuntimeURL = "types.docker.com/RuntimePlugin" ) // NetworkAttachmentSpec represents the runtime spec type for network // attachment tasks type NetworkAttachmentSpec struct { ContainerID string } // RuntimeSpec defines the base payload which clients can specify for creating // a service with the plugin runtime. type RuntimeSpec = runtime.PluginSpec // RuntimePrivilege describes a permission the user has to accept // upon installing a plugin. type RuntimePrivilege = runtime.PluginPrivilege
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/common.go
vendor/github.com/docker/docker/api/types/swarm/common.go
package swarm import ( "strconv" "time" ) // Version represents the internal object version. type Version struct { Index uint64 `json:",omitempty"` } // String implements fmt.Stringer interface. func (v Version) String() string { return strconv.FormatUint(v.Index, 10) } // Meta is a base object inherited by most of the other once. type Meta struct { Version Version `json:",omitempty"` CreatedAt time.Time `json:",omitempty"` UpdatedAt time.Time `json:",omitempty"` } // Annotations represents how to describe an object. type Annotations struct { Name string `json:",omitempty"` Labels map[string]string `json:"Labels"` } // Driver represents a driver (network, logging, secrets backend). type Driver struct { Name string `json:",omitempty"` Options map[string]string `json:",omitempty"` } // TLSInfo represents the TLS information about what CA certificate is trusted, // and who the issuer for a TLS certificate is type TLSInfo struct { // TrustRoot is the trusted CA root certificate in PEM format TrustRoot string `json:",omitempty"` // CertIssuer is the raw subject bytes of the issuer CertIssuerSubject []byte `json:",omitempty"` // CertIssuerPublicKey is the raw public key bytes of the issuer CertIssuerPublicKey []byte `json:",omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/swarm/runtime/runtime.go
vendor/github.com/docker/docker/api/types/swarm/runtime/runtime.go
package runtime import "fmt" // PluginSpec defines the base payload which clients can specify for creating // a service with the plugin runtime. type PluginSpec struct { Name string `json:"name,omitempty"` Remote string `json:"remote,omitempty"` Privileges []*PluginPrivilege `json:"privileges,omitempty"` Disabled bool `json:"disabled,omitempty"` Env []string `json:"env,omitempty"` } // PluginPrivilege describes a permission the user has to accept // upon installing a plugin. type PluginPrivilege struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Value []string `json:"value,omitempty"` } var ( ErrInvalidLengthPlugin = fmt.Errorf("proto: negative length found during unmarshaling") // Deprecated: this error was only used internally and is no longer used. ErrIntOverflowPlugin = fmt.Errorf("proto: integer overflow") // Deprecated: this error was only used internally and is no longer used. ErrUnexpectedEndOfGroupPlugin = fmt.Errorf("proto: unexpected end of group") // Deprecated: this error was only used internally and is no longer used. )
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/mount/mount.go
vendor/github.com/docker/docker/api/types/mount/mount.go
package mount import ( "os" ) // Type represents the type of a mount. type Type string // Type constants const ( // TypeBind is the type for mounting host dir TypeBind Type = "bind" // TypeVolume is the type for remote storage volumes TypeVolume Type = "volume" // TypeTmpfs is the type for mounting tmpfs TypeTmpfs Type = "tmpfs" // TypeNamedPipe is the type for mounting Windows named pipes TypeNamedPipe Type = "npipe" // TypeCluster is the type for Swarm Cluster Volumes. TypeCluster Type = "cluster" // TypeImage is the type for mounting another image's filesystem TypeImage Type = "image" ) // Mount represents a mount (volume). type Mount struct { Type Type `json:",omitempty"` // Source specifies the name of the mount. Depending on mount type, this // may be a volume name or a host path, or even ignored. // Source is not supported for tmpfs (must be an empty value) Source string `json:",omitempty"` Target string `json:",omitempty"` ReadOnly bool `json:",omitempty"` // attempts recursive read-only if possible Consistency Consistency `json:",omitempty"` BindOptions *BindOptions `json:",omitempty"` VolumeOptions *VolumeOptions `json:",omitempty"` ImageOptions *ImageOptions `json:",omitempty"` TmpfsOptions *TmpfsOptions `json:",omitempty"` ClusterOptions *ClusterOptions `json:",omitempty"` } // Propagation represents the propagation of a mount. type Propagation string const ( // PropagationRPrivate RPRIVATE PropagationRPrivate Propagation = "rprivate" // PropagationPrivate PRIVATE PropagationPrivate Propagation = "private" // PropagationRShared RSHARED PropagationRShared Propagation = "rshared" // PropagationShared SHARED PropagationShared Propagation = "shared" // PropagationRSlave RSLAVE PropagationRSlave Propagation = "rslave" // PropagationSlave SLAVE PropagationSlave Propagation = "slave" ) // Propagations is the list of all valid mount propagations var Propagations = []Propagation{ PropagationRPrivate, PropagationPrivate, PropagationRShared, PropagationShared, PropagationRSlave, PropagationSlave, } // Consistency represents the consistency requirements of a mount. type Consistency string const ( // ConsistencyFull guarantees bind mount-like consistency ConsistencyFull Consistency = "consistent" // ConsistencyCached mounts can cache read data and FS structure ConsistencyCached Consistency = "cached" // ConsistencyDelegated mounts can cache read and written data and structure ConsistencyDelegated Consistency = "delegated" // ConsistencyDefault provides "consistent" behavior unless overridden ConsistencyDefault Consistency = "default" ) // BindOptions defines options specific to mounts of type "bind". type BindOptions struct { Propagation Propagation `json:",omitempty"` NonRecursive bool `json:",omitempty"` CreateMountpoint bool `json:",omitempty"` // ReadOnlyNonRecursive makes the mount non-recursively read-only, but still leaves the mount recursive // (unless NonRecursive is set to true in conjunction). ReadOnlyNonRecursive bool `json:",omitempty"` // ReadOnlyForceRecursive raises an error if the mount cannot be made recursively read-only. ReadOnlyForceRecursive bool `json:",omitempty"` } // VolumeOptions represents the options for a mount of type volume. type VolumeOptions struct { NoCopy bool `json:",omitempty"` Labels map[string]string `json:",omitempty"` Subpath string `json:",omitempty"` DriverConfig *Driver `json:",omitempty"` } type ImageOptions struct { Subpath string `json:",omitempty"` } // Driver represents a volume driver. type Driver struct { Name string `json:",omitempty"` Options map[string]string `json:",omitempty"` } // TmpfsOptions defines options specific to mounts of type "tmpfs". type TmpfsOptions struct { // Size sets the size of the tmpfs, in bytes. // // This will be converted to an operating system specific value // depending on the host. For example, on linux, it will be converted to // use a 'k', 'm' or 'g' syntax. BSD, though not widely supported with // docker, uses a straight byte value. // // Percentages are not supported. SizeBytes int64 `json:",omitempty"` // Mode of the tmpfs upon creation Mode os.FileMode `json:",omitempty"` // Options to be passed to the tmpfs mount. An array of arrays. Flag // options should be provided as 1-length arrays. Other types should be // provided as 2-length arrays, where the first item is the key and the // second the value. Options [][]string `json:",omitempty"` // TODO(stevvooe): There are several more tmpfs flags, specified in the // daemon, that are accepted. Only the most basic are added for now. // // From https://github.com/moby/sys/blob/mount/v0.1.1/mount/flags.go#L47-L56 // // var validFlags = map[string]bool{ // "": true, // "size": true, X // "mode": true, X // "uid": true, // "gid": true, // "nr_inodes": true, // "nr_blocks": true, // "mpol": true, // } // // Some of these may be straightforward to add, but others, such as // uid/gid have implications in a clustered system. } // ClusterOptions specifies options for a Cluster volume. type ClusterOptions struct { // intentionally empty }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/time/timestamp.go
vendor/github.com/docker/docker/api/types/time/timestamp.go
package time import ( "fmt" "math" "strconv" "strings" "time" ) // These are additional predefined layouts for use in Time.Format and Time.Parse // with --since and --until parameters for `docker logs` and `docker events` const ( rFC3339Local = "2006-01-02T15:04:05" // RFC3339 with local timezone rFC3339NanoLocal = "2006-01-02T15:04:05.999999999" // RFC3339Nano with local timezone dateWithZone = "2006-01-02Z07:00" // RFC3339 with time at 00:00:00 dateLocal = "2006-01-02" // RFC3339 with local timezone and time at 00:00:00 ) // GetTimestamp tries to parse given string as golang duration, // then RFC3339 time and finally as a Unix timestamp. If // any of these were successful, it returns a Unix timestamp // as string otherwise returns the given value back. // In case of duration input, the returned timestamp is computed // as the given reference time minus the amount of the duration. func GetTimestamp(value string, reference time.Time) (string, error) { if d, err := time.ParseDuration(value); value != "0" && err == nil { return strconv.FormatInt(reference.Add(-d).Unix(), 10), nil } var format string // if the string has a Z or a + or three dashes use parse otherwise use parseinlocation parseInLocation := !strings.ContainsAny(value, "zZ+") && strings.Count(value, "-") != 3 if strings.Contains(value, ".") { if parseInLocation { format = rFC3339NanoLocal } else { format = time.RFC3339Nano } } else if strings.Contains(value, "T") { // we want the number of colons in the T portion of the timestamp tcolons := strings.Count(value, ":") // if parseInLocation is off and we have a +/- zone offset (not Z) then // there will be an extra colon in the input for the tz offset subtract that // colon from the tcolons count if !parseInLocation && !strings.ContainsAny(value, "zZ") && tcolons > 0 { tcolons-- } if parseInLocation { switch tcolons { case 0: format = "2006-01-02T15" case 1: format = "2006-01-02T15:04" default: format = rFC3339Local } } else { switch tcolons { case 0: format = "2006-01-02T15Z07:00" case 1: format = "2006-01-02T15:04Z07:00" default: format = time.RFC3339 } } } else if parseInLocation { format = dateLocal } else { format = dateWithZone } var t time.Time var err error if parseInLocation { t, err = time.ParseInLocation(format, value, time.FixedZone(reference.Zone())) } else { t, err = time.Parse(format, value) } if err != nil { // if there is a `-` then it's an RFC3339 like timestamp if strings.Contains(value, "-") { return "", err // was probably an RFC3339 like timestamp but the parser failed with an error } if _, _, err := parseTimestamp(value); err != nil { return "", fmt.Errorf("failed to parse value as time or duration: %q", value) } return value, nil // unix timestamp in and out case (meaning: the value passed at the command line is already in the right format for passing to the server) } return fmt.Sprintf("%d.%09d", t.Unix(), int64(t.Nanosecond())), nil } // ParseTimestamps returns seconds and nanoseconds from a timestamp that has // the format ("%d.%09d", time.Unix(), int64(time.Nanosecond())). // If the incoming nanosecond portion is longer than 9 digits it is truncated. // The expectation is that the seconds and nanoseconds will be used to create a // time variable. For example: // // seconds, nanoseconds, _ := ParseTimestamp("1136073600.000000001",0) // since := time.Unix(seconds, nanoseconds) // // returns seconds as defaultSeconds if value == "" func ParseTimestamps(value string, defaultSeconds int64) (seconds int64, nanoseconds int64, _ error) { if value == "" { return defaultSeconds, 0, nil } return parseTimestamp(value) } func parseTimestamp(value string) (seconds int64, nanoseconds int64, _ error) { s, n, ok := strings.Cut(value, ".") sec, err := strconv.ParseInt(s, 10, 64) if err != nil { return sec, 0, err } if !ok { return sec, 0, nil } nsec, err := strconv.ParseInt(n, 10, 64) if err != nil { return sec, nsec, err } // should already be in nanoseconds but just in case convert n to nanoseconds nsec = int64(float64(nsec) * math.Pow(float64(10), float64(9-len(n)))) return sec, nsec, nil }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/build/cache.go
vendor/github.com/docker/docker/api/types/build/cache.go
package build import ( "time" "github.com/docker/docker/api/types/filters" ) // CacheRecord contains information about a build cache record. type CacheRecord struct { // ID is the unique ID of the build cache record. ID string // Parent is the ID of the parent build cache record. // // Deprecated: deprecated in API v1.42 and up, as it was deprecated in BuildKit; use Parents instead. Parent string `json:"Parent,omitempty"` // Parents is the list of parent build cache record IDs. Parents []string `json:" Parents,omitempty"` // Type is the cache record type. Type string // Description is a description of the build-step that produced the build cache. Description string // InUse indicates if the build cache is in use. InUse bool // Shared indicates if the build cache is shared. Shared bool // Size is the amount of disk space used by the build cache (in bytes). Size int64 // CreatedAt is the date and time at which the build cache was created. CreatedAt time.Time // LastUsedAt is the date and time at which the build cache was last used. LastUsedAt *time.Time UsageCount int } // CachePruneOptions hold parameters to prune the build cache. type CachePruneOptions struct { All bool ReservedSpace int64 MaxUsedSpace int64 MinFreeSpace int64 Filters filters.Args KeepStorage int64 // Deprecated: deprecated in API 1.48. } // CachePruneReport contains the response for Engine API: // POST "/build/prune" type CachePruneReport struct { CachesDeleted []string SpaceReclaimed uint64 }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/build/build.go
vendor/github.com/docker/docker/api/types/build/build.go
package build import ( "io" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/registry" ) // BuilderVersion sets the version of underlying builder to use type BuilderVersion string const ( // BuilderV1 is the first generation builder in docker daemon BuilderV1 BuilderVersion = "1" // BuilderBuildKit is builder based on moby/buildkit project BuilderBuildKit BuilderVersion = "2" ) // Result contains the image id of a successful build. type Result struct { ID string } // ImageBuildOptions holds the information // necessary to build images. type ImageBuildOptions struct { Tags []string SuppressOutput bool RemoteContext string NoCache bool Remove bool ForceRemove bool PullParent bool Isolation container.Isolation CPUSetCPUs string CPUSetMems string CPUShares int64 CPUQuota int64 CPUPeriod int64 Memory int64 MemorySwap int64 CgroupParent string NetworkMode string ShmSize int64 Dockerfile string Ulimits []*container.Ulimit // BuildArgs needs to be a *string instead of just a string so that // we can tell the difference between "" (empty string) and no value // at all (nil). See the parsing of buildArgs in // api/server/router/build/build_routes.go for even more info. BuildArgs map[string]*string AuthConfigs map[string]registry.AuthConfig Context io.Reader Labels map[string]string // squash the resulting image's layers to the parent // preserves the original image and creates a new one from the parent with all // the changes applied to a single layer Squash bool // CacheFrom specifies images that are used for matching cache. Images // specified here do not need to have a valid parent chain to match cache. CacheFrom []string SecurityOpt []string ExtraHosts []string // List of extra hosts Target string SessionID string Platform string // Version specifies the version of the underlying builder to use Version BuilderVersion // BuildID is an optional identifier that can be passed together with the // build request. The same identifier can be used to gracefully cancel the // build with the cancel request. BuildID string // Outputs defines configurations for exporting build results. Only supported // in BuildKit mode Outputs []ImageBuildOutput } // ImageBuildOutput defines configuration for exporting a build result type ImageBuildOutput struct { Type string Attrs map[string]string } // ImageBuildResponse holds information // returned by a server after building // an image. type ImageBuildResponse struct { Body io.ReadCloser OSType string }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/build/disk_usage.go
vendor/github.com/docker/docker/api/types/build/disk_usage.go
package build // CacheDiskUsage contains disk usage for the build cache. // // Deprecated: this type is no longer used and will be removed in the next release. type CacheDiskUsage struct { TotalSize int64 Reclaimable int64 Items []*CacheRecord }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/common/id_response.go
vendor/github.com/docker/docker/api/types/common/id_response.go
package common // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // IDResponse Response to an API call that returns just an Id // swagger:model IDResponse type IDResponse struct { // The id of the newly created object. // Required: true ID string `json:"Id"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/events/events.go
vendor/github.com/docker/docker/api/types/events/events.go
package events import "github.com/docker/docker/api/types/filters" // Type is used for event-types. type Type string // List of known event types. const ( BuilderEventType Type = "builder" // BuilderEventType is the event type that the builder generates. ConfigEventType Type = "config" // ConfigEventType is the event type that configs generate. ContainerEventType Type = "container" // ContainerEventType is the event type that containers generate. DaemonEventType Type = "daemon" // DaemonEventType is the event type that daemon generate. ImageEventType Type = "image" // ImageEventType is the event type that images generate. NetworkEventType Type = "network" // NetworkEventType is the event type that networks generate. NodeEventType Type = "node" // NodeEventType is the event type that nodes generate. PluginEventType Type = "plugin" // PluginEventType is the event type that plugins generate. SecretEventType Type = "secret" // SecretEventType is the event type that secrets generate. ServiceEventType Type = "service" // ServiceEventType is the event type that services generate. VolumeEventType Type = "volume" // VolumeEventType is the event type that volumes generate. ) // Action is used for event-actions. type Action string const ( ActionCreate Action = "create" ActionStart Action = "start" ActionRestart Action = "restart" ActionStop Action = "stop" ActionCheckpoint Action = "checkpoint" ActionPause Action = "pause" ActionUnPause Action = "unpause" ActionAttach Action = "attach" ActionDetach Action = "detach" ActionResize Action = "resize" ActionUpdate Action = "update" ActionRename Action = "rename" ActionKill Action = "kill" ActionDie Action = "die" ActionOOM Action = "oom" ActionDestroy Action = "destroy" ActionRemove Action = "remove" ActionCommit Action = "commit" ActionTop Action = "top" ActionCopy Action = "copy" ActionArchivePath Action = "archive-path" ActionExtractToDir Action = "extract-to-dir" ActionExport Action = "export" ActionImport Action = "import" ActionSave Action = "save" ActionLoad Action = "load" ActionTag Action = "tag" ActionUnTag Action = "untag" ActionPush Action = "push" ActionPull Action = "pull" ActionPrune Action = "prune" ActionDelete Action = "delete" ActionEnable Action = "enable" ActionDisable Action = "disable" ActionConnect Action = "connect" ActionDisconnect Action = "disconnect" ActionReload Action = "reload" ActionMount Action = "mount" ActionUnmount Action = "unmount" // ActionExecCreate is the prefix used for exec_create events. These // event-actions are commonly followed by a colon and space (": "), // and the command that's defined for the exec, for example: // // exec_create: /bin/sh -c 'echo hello' // // This is far from ideal; it's a compromise to allow filtering and // to preserve backward-compatibility. ActionExecCreate Action = "exec_create" // ActionExecStart is the prefix used for exec_create events. These // event-actions are commonly followed by a colon and space (": "), // and the command that's defined for the exec, for example: // // exec_start: /bin/sh -c 'echo hello' // // This is far from ideal; it's a compromise to allow filtering and // to preserve backward-compatibility. ActionExecStart Action = "exec_start" ActionExecDie Action = "exec_die" ActionExecDetach Action = "exec_detach" // ActionHealthStatus is the prefix to use for health_status events. // // Health-status events can either have a pre-defined status, in which // case the "health_status" action is followed by a colon, or can be // "free-form", in which case they're followed by the output of the // health-check output. // // This is far form ideal, and a compromise to allow filtering, and // to preserve backward-compatibility. ActionHealthStatus Action = "health_status" ActionHealthStatusRunning Action = "health_status: running" ActionHealthStatusHealthy Action = "health_status: healthy" ActionHealthStatusUnhealthy Action = "health_status: unhealthy" ) // Actor describes something that generates events, // like a container, or a network, or a volume. // It has a defined name and a set of attributes. // The container attributes are its labels, other actors // can generate these attributes from other properties. type Actor struct { ID string Attributes map[string]string } // Message represents the information an event contains type Message struct { // Deprecated: use Action instead. // Information from JSONMessage. // With data only in container events. Status string `json:"status,omitempty"` // Deprecated: use Actor.ID instead. ID string `json:"id,omitempty"` // Deprecated: use Actor.Attributes["image"] instead. From string `json:"from,omitempty"` Type Type Action Action Actor Actor // Engine events are local scope. Cluster events are swarm scope. Scope string `json:"scope,omitempty"` Time int64 `json:"time,omitempty"` TimeNano int64 `json:"timeNano,omitempty"` } // ListOptions holds parameters to filter events with. type ListOptions struct { Since string Until string Filters filters.Args }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/filters/errors.go
vendor/github.com/docker/docker/api/types/filters/errors.go
package filters import "fmt" // invalidFilter indicates that the provided filter or its value is invalid type invalidFilter struct { Filter string Value []string } func (e invalidFilter) Error() string { msg := "invalid filter" if e.Filter != "" { msg += " '" + e.Filter if e.Value != nil { msg = fmt.Sprintf("%s=%s", msg, e.Value) } msg += "'" } return msg } // InvalidParameter marks this error as ErrInvalidParameter func (e invalidFilter) InvalidParameter() {}
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/filters/filters_deprecated.go
vendor/github.com/docker/docker/api/types/filters/filters_deprecated.go
package filters import ( "encoding/json" "github.com/docker/docker/api/types/versions" ) // ToParamWithVersion encodes Args as a JSON string. If version is less than 1.22 // then the encoded format will use an older legacy format where the values are a // list of strings, instead of a set. // // Deprecated: do not use in any new code; use ToJSON instead func ToParamWithVersion(version string, a Args) (string, error) { out, err := ToJSON(a) if out == "" || err != nil { return "", nil } if version != "" && versions.LessThan(version, "1.22") { return encodeLegacyFilters(out) } return out, nil } // encodeLegacyFilters encodes Args in the legacy format as used in API v1.21 and older. // where values are a list of strings, instead of a set. // // Don't use in any new code; use [filters.ToJSON]] instead. func encodeLegacyFilters(currentFormat string) (string, error) { // The Args.fields field is not exported, but used to marshal JSON, // so we'll marshal to the new format, then unmarshal to get the // fields, and marshal again. // // This is far from optimal, but this code is only used for deprecated // API versions, so should not be hit commonly. var argsFields map[string]map[string]bool err := json.Unmarshal([]byte(currentFormat), &argsFields) if err != nil { return "", err } buf, err := json.Marshal(convertArgsToSlice(argsFields)) if err != nil { return "", err } return string(buf), nil } func convertArgsToSlice(f map[string]map[string]bool) map[string][]string { m := map[string][]string{} for k, v := range f { values := []string{} for kk := range v { if v[kk] { values = append(values, kk) } } m[k] = values } return m }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/filters/parse.go
vendor/github.com/docker/docker/api/types/filters/parse.go
/* Package filters provides tools for encoding a mapping of keys to a set of multiple values. */ package filters import ( "encoding/json" "regexp" "strings" ) // Args stores a mapping of keys to a set of multiple values. type Args struct { fields map[string]map[string]bool } // KeyValuePair are used to initialize a new Args type KeyValuePair struct { Key string Value string } // Arg creates a new KeyValuePair for initializing Args func Arg(key, value string) KeyValuePair { return KeyValuePair{Key: key, Value: value} } // NewArgs returns a new Args populated with the initial args func NewArgs(initialArgs ...KeyValuePair) Args { args := Args{fields: map[string]map[string]bool{}} for _, arg := range initialArgs { args.Add(arg.Key, arg.Value) } return args } // Keys returns all the keys in list of Args func (args Args) Keys() []string { keys := make([]string, 0, len(args.fields)) for k := range args.fields { keys = append(keys, k) } return keys } // MarshalJSON returns a JSON byte representation of the Args func (args Args) MarshalJSON() ([]byte, error) { if len(args.fields) == 0 { return []byte("{}"), nil } return json.Marshal(args.fields) } // ToJSON returns the Args as a JSON encoded string func ToJSON(a Args) (string, error) { if a.Len() == 0 { return "", nil } buf, err := json.Marshal(a) return string(buf), err } // FromJSON decodes a JSON encoded string into Args func FromJSON(p string) (Args, error) { args := NewArgs() if p == "" { return args, nil } raw := []byte(p) err := json.Unmarshal(raw, &args) if err == nil { return args, nil } // Fallback to parsing arguments in the legacy slice format deprecated := map[string][]string{} if legacyErr := json.Unmarshal(raw, &deprecated); legacyErr != nil { return args, &invalidFilter{} } args.fields = deprecatedArgs(deprecated) return args, nil } // UnmarshalJSON populates the Args from JSON encode bytes func (args Args) UnmarshalJSON(raw []byte) error { return json.Unmarshal(raw, &args.fields) } // Get returns the list of values associated with the key func (args Args) Get(key string) []string { values := args.fields[key] if values == nil { return make([]string, 0) } slice := make([]string, 0, len(values)) for key := range values { slice = append(slice, key) } return slice } // Add a new value to the set of values func (args Args) Add(key, value string) { if _, ok := args.fields[key]; ok { args.fields[key][value] = true } else { args.fields[key] = map[string]bool{value: true} } } // Del removes a value from the set func (args Args) Del(key, value string) { if _, ok := args.fields[key]; ok { delete(args.fields[key], value) if len(args.fields[key]) == 0 { delete(args.fields, key) } } } // Len returns the number of keys in the mapping func (args Args) Len() int { return len(args.fields) } // MatchKVList returns true if all the pairs in sources exist as key=value // pairs in the mapping at key, or if there are no values at key. func (args Args) MatchKVList(key string, sources map[string]string) bool { fieldValues := args.fields[key] // do not filter if there is no filter set or cannot determine filter if len(fieldValues) == 0 { return true } if len(sources) == 0 { return false } for value := range fieldValues { testK, testV, hasValue := strings.Cut(value, "=") v, ok := sources[testK] if !ok { return false } if hasValue && testV != v { return false } } return true } // Match returns true if any of the values at key match the source string func (args Args) Match(field, source string) bool { if args.ExactMatch(field, source) { return true } fieldValues := args.fields[field] for name2match := range fieldValues { match, err := regexp.MatchString(name2match, source) if err != nil { continue } if match { return true } } return false } // GetBoolOrDefault returns a boolean value of the key if the key is present // and is interpretable as a boolean value. Otherwise the default value is returned. // Error is not nil only if the filter values are not valid boolean or are conflicting. func (args Args) GetBoolOrDefault(key string, defaultValue bool) (bool, error) { fieldValues, ok := args.fields[key] if !ok { return defaultValue, nil } if len(fieldValues) == 0 { return defaultValue, &invalidFilter{key, nil} } isFalse := fieldValues["0"] || fieldValues["false"] isTrue := fieldValues["1"] || fieldValues["true"] if isFalse == isTrue { // Either no or conflicting truthy/falsy value were provided return defaultValue, &invalidFilter{key, args.Get(key)} } return isTrue, nil } // ExactMatch returns true if the source matches exactly one of the values. func (args Args) ExactMatch(key, source string) bool { fieldValues, ok := args.fields[key] // do not filter if there is no filter set or cannot determine filter if !ok || len(fieldValues) == 0 { return true } // try to match full name value to avoid O(N) regular expression matching return fieldValues[source] } // UniqueExactMatch returns true if there is only one value and the source // matches exactly the value. func (args Args) UniqueExactMatch(key, source string) bool { fieldValues := args.fields[key] // do not filter if there is no filter set or cannot determine filter if len(fieldValues) == 0 { return true } if len(args.fields[key]) != 1 { return false } // try to match full name value to avoid O(N) regular expression matching return fieldValues[source] } // FuzzyMatch returns true if the source matches exactly one value, or the // source has one of the values as a prefix. func (args Args) FuzzyMatch(key, source string) bool { if args.ExactMatch(key, source) { return true } fieldValues := args.fields[key] for prefix := range fieldValues { if strings.HasPrefix(source, prefix) { return true } } return false } // Contains returns true if the key exists in the mapping func (args Args) Contains(field string) bool { _, ok := args.fields[field] return ok } // Validate compared the set of accepted keys against the keys in the mapping. // An error is returned if any mapping keys are not in the accepted set. func (args Args) Validate(accepted map[string]bool) error { for name := range args.fields { if !accepted[name] { return &invalidFilter{name, nil} } } return nil } // WalkValues iterates over the list of values for a key in the mapping and calls // op() for each value. If op returns an error the iteration stops and the // error is returned. func (args Args) WalkValues(field string, op func(value string) error) error { if _, ok := args.fields[field]; !ok { return nil } for v := range args.fields[field] { if err := op(v); err != nil { return err } } return nil } // Clone returns a copy of args. func (args Args) Clone() (newArgs Args) { newArgs.fields = make(map[string]map[string]bool, len(args.fields)) for k, m := range args.fields { var mm map[string]bool if m != nil { mm = make(map[string]bool, len(m)) for kk, v := range m { mm[kk] = v } } newArgs.fields[k] = mm } return newArgs } func deprecatedArgs(d map[string][]string) map[string]map[string]bool { m := map[string]map[string]bool{} for k, v := range d { values := map[string]bool{} for _, vv := range v { values[vv] = true } m[k] = values } return m }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/blkiodev/blkio.go
vendor/github.com/docker/docker/api/types/blkiodev/blkio.go
package blkiodev import "fmt" // WeightDevice is a structure that holds device:weight pair type WeightDevice struct { Path string Weight uint16 } func (w *WeightDevice) String() string { return fmt.Sprintf("%s:%d", w.Path, w.Weight) } // ThrottleDevice is a structure that holds device:rate_per_second pair type ThrottleDevice struct { Path string Rate uint64 } func (t *ThrottleDevice) String() string { return fmt.Sprintf("%s:%d", t.Path, t.Rate) }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/network/network.go
vendor/github.com/docker/docker/api/types/network/network.go
package network import ( "time" "github.com/docker/docker/api/types/filters" ) const ( // NetworkDefault is a platform-independent alias to choose the platform-specific default network stack. NetworkDefault = "default" // NetworkHost is the name of the predefined network used when the NetworkMode host is selected (only available on Linux) NetworkHost = "host" // NetworkNone is the name of the predefined network used when the NetworkMode none is selected (available on both Linux and Windows) NetworkNone = "none" // NetworkBridge is the name of the default network on Linux NetworkBridge = "bridge" // NetworkNat is the name of the default network on Windows NetworkNat = "nat" ) // CreateRequest is the request message sent to the server for network create call. type CreateRequest struct { CreateOptions Name string // Name is the requested name of the network. // Deprecated: CheckDuplicate is deprecated since API v1.44, but it defaults to true when sent by the client // package to older daemons. CheckDuplicate *bool `json:",omitempty"` } // CreateOptions holds options to create a network. type CreateOptions struct { Driver string // Driver is the driver-name used to create the network (e.g. `bridge`, `overlay`) Scope string // Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level). EnableIPv4 *bool `json:",omitempty"` // EnableIPv4 represents whether to enable IPv4. EnableIPv6 *bool `json:",omitempty"` // EnableIPv6 represents whether to enable IPv6. IPAM *IPAM // IPAM is the network's IP Address Management. Internal bool // Internal represents if the network is used internal only. Attachable bool // Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode. Ingress bool // Ingress indicates the network is providing the routing-mesh for the swarm cluster. ConfigOnly bool // ConfigOnly creates a config-only network. Config-only networks are place-holder networks for network configurations to be used by other networks. ConfigOnly networks cannot be used directly to run containers or services. ConfigFrom *ConfigReference // ConfigFrom specifies the source which will provide the configuration for this network. The specified network must be a config-only network; see [CreateOptions.ConfigOnly]. Options map[string]string // Options specifies the network-specific options to use for when creating the network. Labels map[string]string // Labels holds metadata specific to the network being created. } // ListOptions holds parameters to filter the list of networks with. type ListOptions struct { Filters filters.Args } // InspectOptions holds parameters to inspect network. type InspectOptions struct { Scope string Verbose bool } // ConnectOptions represents the data to be used to connect a container to the // network. type ConnectOptions struct { Container string EndpointConfig *EndpointSettings `json:",omitempty"` } // DisconnectOptions represents the data to be used to disconnect a container // from the network. type DisconnectOptions struct { Container string Force bool } // Inspect is the body of the "get network" http response message. type Inspect struct { Name string // Name is the name of the network ID string `json:"Id"` // ID uniquely identifies a network on a single machine Created time.Time // Created is the time the network created Scope string // Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level) Driver string // Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`) EnableIPv4 bool // EnableIPv4 represents whether IPv4 is enabled EnableIPv6 bool // EnableIPv6 represents whether IPv6 is enabled IPAM IPAM // IPAM is the network's IP Address Management Internal bool // Internal represents if the network is used internal only Attachable bool // Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode. Ingress bool // Ingress indicates the network is providing the routing-mesh for the swarm cluster. ConfigFrom ConfigReference // ConfigFrom specifies the source which will provide the configuration for this network. ConfigOnly bool // ConfigOnly networks are place-holder networks for network configurations to be used by other networks. ConfigOnly networks cannot be used directly to run containers or services. Containers map[string]EndpointResource // Containers contains endpoints belonging to the network Options map[string]string // Options holds the network specific options to use for when creating the network Labels map[string]string // Labels holds metadata specific to the network being created Peers []PeerInfo `json:",omitempty"` // List of peer nodes for an overlay network Services map[string]ServiceInfo `json:",omitempty"` } // Summary is used as response when listing networks. It currently is an alias // for [Inspect], but may diverge in the future, as not all information may // be included when listing networks. type Summary = Inspect // Address represents an IP address type Address struct { Addr string PrefixLen int } // PeerInfo represents one peer of an overlay network type PeerInfo struct { Name string IP string } // Task carries the information about one backend task type Task struct { Name string EndpointID string EndpointIP string Info map[string]string } // ServiceInfo represents service parameters with the list of service's tasks type ServiceInfo struct { VIP string Ports []string LocalLBIndex int Tasks []Task } // EndpointResource contains network resources allocated and used for a // container in a network. type EndpointResource struct { Name string EndpointID string MacAddress string IPv4Address string IPv6Address string } // NetworkingConfig represents the container's networking configuration for each of its interfaces // Carries the networking configs specified in the `docker run` and `docker network connect` commands type NetworkingConfig struct { EndpointsConfig map[string]*EndpointSettings // Endpoint configs for each connecting network } // ConfigReference specifies the source which provides a network's configuration type ConfigReference struct { Network string } var acceptedFilters = map[string]bool{ "dangling": true, "driver": true, "id": true, "label": true, "name": true, "scope": true, "type": true, } // ValidateFilters validates the list of filter args with the available filters. func ValidateFilters(filter filters.Args) error { return filter.Validate(acceptedFilters) } // PruneReport contains the response for Engine API: // POST "/networks/prune" type PruneReport struct { NetworksDeleted []string }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/network/ipam.go
vendor/github.com/docker/docker/api/types/network/ipam.go
package network import ( "errors" "fmt" "net/netip" "strings" ) // IPAM represents IP Address Management type IPAM struct { Driver string Options map[string]string // Per network IPAM driver options Config []IPAMConfig } // IPAMConfig represents IPAM configurations type IPAMConfig struct { Subnet string `json:",omitempty"` IPRange string `json:",omitempty"` Gateway string `json:",omitempty"` AuxAddress map[string]string `json:"AuxiliaryAddresses,omitempty"` } type ipFamily string const ( ip4 ipFamily = "IPv4" ip6 ipFamily = "IPv6" ) // ValidateIPAM checks whether the network's IPAM passed as argument is valid. It returns a joinError of the list of // errors found. func ValidateIPAM(ipam *IPAM, enableIPv6 bool) error { if ipam == nil { return nil } var errs []error for _, cfg := range ipam.Config { subnet, err := netip.ParsePrefix(cfg.Subnet) if err != nil { errs = append(errs, fmt.Errorf("invalid subnet %s: invalid CIDR block notation", cfg.Subnet)) continue } subnetFamily := ip4 if subnet.Addr().Is6() { subnetFamily = ip6 } if !enableIPv6 && subnetFamily == ip6 { continue } if subnet != subnet.Masked() { errs = append(errs, fmt.Errorf("invalid subnet %s: it should be %s", subnet, subnet.Masked())) } if ipRangeErrs := validateIPRange(cfg.IPRange, subnet, subnetFamily); len(ipRangeErrs) > 0 { errs = append(errs, ipRangeErrs...) } if err := validateAddress(cfg.Gateway, subnet, subnetFamily); err != nil { errs = append(errs, fmt.Errorf("invalid gateway %s: %w", cfg.Gateway, err)) } for auxName, aux := range cfg.AuxAddress { if err := validateAddress(aux, subnet, subnetFamily); err != nil { errs = append(errs, fmt.Errorf("invalid auxiliary address %s: %w", auxName, err)) } } } if err := errJoin(errs...); err != nil { return fmt.Errorf("invalid network config:\n%w", err) } return nil } func validateIPRange(ipRange string, subnet netip.Prefix, subnetFamily ipFamily) []error { if ipRange == "" { return nil } prefix, err := netip.ParsePrefix(ipRange) if err != nil { return []error{fmt.Errorf("invalid ip-range %s: invalid CIDR block notation", ipRange)} } family := ip4 if prefix.Addr().Is6() { family = ip6 } if family != subnetFamily { return []error{fmt.Errorf("invalid ip-range %s: parent subnet is an %s block", ipRange, subnetFamily)} } var errs []error if prefix.Bits() < subnet.Bits() { errs = append(errs, fmt.Errorf("invalid ip-range %s: CIDR block is bigger than its parent subnet %s", ipRange, subnet)) } if prefix != prefix.Masked() { errs = append(errs, fmt.Errorf("invalid ip-range %s: it should be %s", prefix, prefix.Masked())) } if !subnet.Overlaps(prefix) { errs = append(errs, fmt.Errorf("invalid ip-range %s: parent subnet %s doesn't contain ip-range", ipRange, subnet)) } return errs } func validateAddress(address string, subnet netip.Prefix, subnetFamily ipFamily) error { if address == "" { return nil } addr, err := netip.ParseAddr(address) if err != nil { return errors.New("invalid address") } family := ip4 if addr.Is6() { family = ip6 } if family != subnetFamily { return fmt.Errorf("parent subnet is an %s block", subnetFamily) } if !subnet.Contains(addr) { return fmt.Errorf("parent subnet %s doesn't contain this address", subnet) } return nil } func errJoin(errs ...error) error { n := 0 for _, err := range errs { if err != nil { n++ } } if n == 0 { return nil } e := &joinError{ errs: make([]error, 0, n), } for _, err := range errs { if err != nil { e.errs = append(e.errs, err) } } return e } type joinError struct { errs []error } func (e *joinError) Error() string { if len(e.errs) == 1 { return strings.TrimSpace(e.errs[0].Error()) } stringErrs := make([]string, 0, len(e.errs)) for _, subErr := range e.errs { stringErrs = append(stringErrs, strings.ReplaceAll(subErr.Error(), "\n", "\n\t")) } return "* " + strings.Join(stringErrs, "\n* ") } func (e *joinError) Unwrap() []error { return e.errs }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/network/create_response.go
vendor/github.com/docker/docker/api/types/network/create_response.go
package network // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // CreateResponse NetworkCreateResponse // // OK response to NetworkCreate operation // swagger:model CreateResponse type CreateResponse struct { // The ID of the created network. // Required: true ID string `json:"Id"` // Warnings encountered when creating the container // Required: true Warning string `json:"Warning"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/network/endpoint.go
vendor/github.com/docker/docker/api/types/network/endpoint.go
package network import ( "errors" "fmt" "net" ) // EndpointSettings stores the network endpoint details type EndpointSettings struct { // Configurations IPAMConfig *EndpointIPAMConfig Links []string Aliases []string // Aliases holds the list of extra, user-specified DNS names for this endpoint. // MacAddress may be used to specify a MAC address when the container is created. // Once the container is running, it becomes operational data (it may contain a // generated address). MacAddress string DriverOpts map[string]string // GwPriority determines which endpoint will provide the default gateway // for the container. The endpoint with the highest priority will be used. // If multiple endpoints have the same priority, they are lexicographically // sorted based on their network name, and the one that sorts first is picked. GwPriority int // Operational data NetworkID string EndpointID string Gateway string IPAddress string IPPrefixLen int IPv6Gateway string GlobalIPv6Address string GlobalIPv6PrefixLen int // DNSNames holds all the (non fully qualified) DNS names associated to this endpoint. First entry is used to // generate PTR records. DNSNames []string } // Copy makes a deep copy of `EndpointSettings` func (es *EndpointSettings) Copy() *EndpointSettings { epCopy := *es if es.IPAMConfig != nil { epCopy.IPAMConfig = es.IPAMConfig.Copy() } if es.Links != nil { links := make([]string, 0, len(es.Links)) epCopy.Links = append(links, es.Links...) } if es.Aliases != nil { aliases := make([]string, 0, len(es.Aliases)) epCopy.Aliases = append(aliases, es.Aliases...) } if len(es.DNSNames) > 0 { epCopy.DNSNames = make([]string, len(es.DNSNames)) copy(epCopy.DNSNames, es.DNSNames) } return &epCopy } // EndpointIPAMConfig represents IPAM configurations for the endpoint type EndpointIPAMConfig struct { IPv4Address string `json:",omitempty"` IPv6Address string `json:",omitempty"` LinkLocalIPs []string `json:",omitempty"` } // Copy makes a copy of the endpoint ipam config func (cfg *EndpointIPAMConfig) Copy() *EndpointIPAMConfig { cfgCopy := *cfg cfgCopy.LinkLocalIPs = make([]string, 0, len(cfg.LinkLocalIPs)) cfgCopy.LinkLocalIPs = append(cfgCopy.LinkLocalIPs, cfg.LinkLocalIPs...) return &cfgCopy } // NetworkSubnet describes a user-defined subnet for a specific network. It's only used to validate if an // EndpointIPAMConfig is valid for a specific network. type NetworkSubnet interface { // Contains checks whether the NetworkSubnet contains [addr]. Contains(addr net.IP) bool // IsStatic checks whether the subnet was statically allocated (ie. user-defined). IsStatic() bool } // IsInRange checks whether static IP addresses are valid in a specific network. func (cfg *EndpointIPAMConfig) IsInRange(v4Subnets []NetworkSubnet, v6Subnets []NetworkSubnet) error { var errs []error if err := validateEndpointIPAddress(cfg.IPv4Address, v4Subnets); err != nil { errs = append(errs, err) } if err := validateEndpointIPAddress(cfg.IPv6Address, v6Subnets); err != nil { errs = append(errs, err) } return errJoin(errs...) } func validateEndpointIPAddress(epAddr string, ipamSubnets []NetworkSubnet) error { if epAddr == "" { return nil } var staticSubnet bool parsedAddr := net.ParseIP(epAddr) for _, subnet := range ipamSubnets { if subnet.IsStatic() { staticSubnet = true if subnet.Contains(parsedAddr) { return nil } } } if staticSubnet { return fmt.Errorf("no configured subnet or ip-range contain the IP address %s", epAddr) } return errors.New("user specified IP address is supported only when connecting to networks with user configured subnets") } // Validate checks whether cfg is valid. func (cfg *EndpointIPAMConfig) Validate() error { if cfg == nil { return nil } var errs []error if cfg.IPv4Address != "" { if addr := net.ParseIP(cfg.IPv4Address); addr == nil || addr.To4() == nil || addr.IsUnspecified() { errs = append(errs, fmt.Errorf("invalid IPv4 address: %s", cfg.IPv4Address)) } } if cfg.IPv6Address != "" { if addr := net.ParseIP(cfg.IPv6Address); addr == nil || addr.To4() != nil || addr.IsUnspecified() { errs = append(errs, fmt.Errorf("invalid IPv6 address: %s", cfg.IPv6Address)) } } for _, addr := range cfg.LinkLocalIPs { if parsed := net.ParseIP(addr); parsed == nil || parsed.IsUnspecified() { errs = append(errs, fmt.Errorf("invalid link-local IP address: %s", addr)) } } return errJoin(errs...) }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/checkpoint/list.go
vendor/github.com/docker/docker/api/types/checkpoint/list.go
package checkpoint // Summary represents the details of a checkpoint when listing endpoints. type Summary struct { // Name is the name of the checkpoint. Name string }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/checkpoint/options.go
vendor/github.com/docker/docker/api/types/checkpoint/options.go
package checkpoint // CreateOptions holds parameters to create a checkpoint from a container. type CreateOptions struct { CheckpointID string CheckpointDir string Exit bool } // ListOptions holds parameters to list checkpoints for a container. type ListOptions struct { CheckpointDir string } // DeleteOptions holds parameters to delete a checkpoint from a container. type DeleteOptions struct { CheckpointID string CheckpointDir string }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/registry/authconfig.go
vendor/github.com/docker/docker/api/types/registry/authconfig.go
package registry import ( "context" "encoding/base64" "encoding/json" "fmt" "io" "strings" ) // AuthHeader is the name of the header used to send encoded registry // authorization credentials for registry operations (push/pull). const AuthHeader = "X-Registry-Auth" // RequestAuthConfig is a function interface that clients can supply // to retry operations after getting an authorization error. // // The function must return the [AuthHeader] value ([AuthConfig]), encoded // in base64url format ([RFC4648, section 5]), which can be decoded by // [DecodeAuthConfig]. // // It must return an error if the privilege request fails. // // [RFC4648, section 5]: https://tools.ietf.org/html/rfc4648#section-5 type RequestAuthConfig func(context.Context) (string, error) // AuthConfig contains authorization information for connecting to a Registry. type AuthConfig struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Auth string `json:"auth,omitempty"` // Email is an optional value associated with the username. // // Deprecated: This field is deprecated since docker 1.11 (API v1.23) and will be removed in the next release. Email string `json:"email,omitempty"` ServerAddress string `json:"serveraddress,omitempty"` // IdentityToken is used to authenticate the user and get // an access token for the registry. IdentityToken string `json:"identitytoken,omitempty"` // RegistryToken is a bearer token to be sent to a registry RegistryToken string `json:"registrytoken,omitempty"` } // EncodeAuthConfig serializes the auth configuration as a base64url encoded // ([RFC4648, section 5]) JSON string for sending through the X-Registry-Auth header. // // [RFC4648, section 5]: https://tools.ietf.org/html/rfc4648#section-5 func EncodeAuthConfig(authConfig AuthConfig) (string, error) { buf, err := json.Marshal(authConfig) if err != nil { return "", errInvalidParameter{err} } return base64.URLEncoding.EncodeToString(buf), nil } // DecodeAuthConfig decodes base64url encoded ([RFC4648, section 5]) JSON // authentication information as sent through the X-Registry-Auth header. // // This function always returns an [AuthConfig], even if an error occurs. It is up // to the caller to decide if authentication is required, and if the error can // be ignored. // // [RFC4648, section 5]: https://tools.ietf.org/html/rfc4648#section-5 func DecodeAuthConfig(authEncoded string) (*AuthConfig, error) { if authEncoded == "" { return &AuthConfig{}, nil } authJSON := base64.NewDecoder(base64.URLEncoding, strings.NewReader(authEncoded)) return decodeAuthConfigFromReader(authJSON) } // DecodeAuthConfigBody decodes authentication information as sent as JSON in the // body of a request. This function is to provide backward compatibility with old // clients and API versions. Current clients and API versions expect authentication // to be provided through the X-Registry-Auth header. // // Like [DecodeAuthConfig], this function always returns an [AuthConfig], even if an // error occurs. It is up to the caller to decide if authentication is required, // and if the error can be ignored. // // Deprecated: this function is no longer used and will be removed in the next release. func DecodeAuthConfigBody(rdr io.ReadCloser) (*AuthConfig, error) { return decodeAuthConfigFromReader(rdr) } func decodeAuthConfigFromReader(rdr io.Reader) (*AuthConfig, error) { authConfig := &AuthConfig{} if err := json.NewDecoder(rdr).Decode(authConfig); err != nil { // always return an (empty) AuthConfig to increase compatibility with // the existing API. return &AuthConfig{}, invalid(err) } return authConfig, nil } func invalid(err error) error { return errInvalidParameter{fmt.Errorf("invalid X-Registry-Auth header: %w", err)} } type errInvalidParameter struct{ error } func (errInvalidParameter) InvalidParameter() {} func (e errInvalidParameter) Cause() error { return e.error } func (e errInvalidParameter) Unwrap() error { return e.error }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/registry/registry.go
vendor/github.com/docker/docker/api/types/registry/registry.go
// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: //go:build go1.23 package registry import ( "encoding/json" "net" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) // ServiceConfig stores daemon registry services configuration. type ServiceConfig struct { AllowNondistributableArtifactsCIDRs []*NetIPNet `json:"AllowNondistributableArtifactsCIDRs,omitempty"` // Deprecated: non-distributable artifacts are deprecated and enabled by default. This field will be removed in the next release. AllowNondistributableArtifactsHostnames []string `json:"AllowNondistributableArtifactsHostnames,omitempty"` // Deprecated: non-distributable artifacts are deprecated and enabled by default. This field will be removed in the next release. InsecureRegistryCIDRs []*NetIPNet `json:"InsecureRegistryCIDRs"` IndexConfigs map[string]*IndexInfo `json:"IndexConfigs"` Mirrors []string // ExtraFields is for internal use to include deprecated fields on older API versions. ExtraFields map[string]any `json:"-"` } // MarshalJSON implements a custom marshaler to include legacy fields // in API responses. func (sc *ServiceConfig) MarshalJSON() ([]byte, error) { type tmp ServiceConfig base, err := json.Marshal((*tmp)(sc)) if err != nil { return nil, err } var merged map[string]any _ = json.Unmarshal(base, &merged) for k, v := range sc.ExtraFields { merged[k] = v } return json.Marshal(merged) } // NetIPNet is the net.IPNet type, which can be marshalled and // unmarshalled to JSON type NetIPNet net.IPNet // String returns the CIDR notation of ipnet func (ipnet *NetIPNet) String() string { return (*net.IPNet)(ipnet).String() } // MarshalJSON returns the JSON representation of the IPNet func (ipnet *NetIPNet) MarshalJSON() ([]byte, error) { return json.Marshal((*net.IPNet)(ipnet).String()) } // UnmarshalJSON sets the IPNet from a byte array of JSON func (ipnet *NetIPNet) UnmarshalJSON(b []byte) error { var ipnetStr string if err := json.Unmarshal(b, &ipnetStr); err != nil { return err } _, cidr, err := net.ParseCIDR(ipnetStr) if err != nil { return err } *ipnet = NetIPNet(*cidr) return nil } // IndexInfo contains information about a registry // // RepositoryInfo Examples: // // { // "Index" : { // "Name" : "docker.io", // "Mirrors" : ["https://registry-2.docker.io/v1/", "https://registry-3.docker.io/v1/"], // "Secure" : true, // "Official" : true, // }, // "RemoteName" : "library/debian", // "LocalName" : "debian", // "CanonicalName" : "docker.io/debian" // "Official" : true, // } // // { // "Index" : { // "Name" : "127.0.0.1:5000", // "Mirrors" : [], // "Secure" : false, // "Official" : false, // }, // "RemoteName" : "user/repo", // "LocalName" : "127.0.0.1:5000/user/repo", // "CanonicalName" : "127.0.0.1:5000/user/repo", // "Official" : false, // } type IndexInfo struct { // Name is the name of the registry, such as "docker.io" Name string // Mirrors is a list of mirrors, expressed as URIs Mirrors []string // Secure is set to false if the registry is part of the list of // insecure registries. Insecure registries accept HTTP and/or accept // HTTPS with certificates from unknown CAs. Secure bool // Official indicates whether this is an official registry Official bool } // DistributionInspect describes the result obtained from contacting the // registry to retrieve image metadata type DistributionInspect struct { // Descriptor contains information about the manifest, including // the content addressable digest Descriptor ocispec.Descriptor // Platforms contains the list of platforms supported by the image, // obtained by parsing the manifest Platforms []ocispec.Platform }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/registry/search.go
vendor/github.com/docker/docker/api/types/registry/search.go
package registry import ( "context" "github.com/docker/docker/api/types/filters" ) // SearchOptions holds parameters to search images with. type SearchOptions struct { RegistryAuth string // PrivilegeFunc is a function that clients can supply to retry operations // after getting an authorization error. This function returns the registry // authentication header value in base64 encoded format, or an error if the // privilege request fails. // // For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. PrivilegeFunc func(context.Context) (string, error) Filters filters.Args Limit int } // SearchResult describes a search result returned from a registry type SearchResult struct { // StarCount indicates the number of stars this repository has StarCount int `json:"star_count"` // IsOfficial is true if the result is from an official repository. IsOfficial bool `json:"is_official"` // Name is the name of the repository Name string `json:"name"` // IsAutomated indicates whether the result is automated. // // Deprecated: the "is_automated" field is deprecated and will always be "false". IsAutomated bool `json:"is_automated"` // Description is a textual description of the repository Description string `json:"description"` } // SearchResults lists a collection search results returned from a registry type SearchResults struct { // Query contains the query string that generated the search results Query string `json:"query"` // NumResults indicates the number of results the query returned NumResults int `json:"num_results"` // Results is a slice containing the actual results for the search Results []SearchResult `json:"results"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/registry/authenticate.go
vendor/github.com/docker/docker/api/types/registry/authenticate.go
package registry // ---------------------------------------------------------------------------- // DO NOT EDIT THIS FILE // This file was generated by `swagger generate operation` // // See hack/generate-swagger-api.sh // ---------------------------------------------------------------------------- // AuthenticateOKBody authenticate o k body // swagger:model AuthenticateOKBody type AuthenticateOKBody struct { // An opaque token used to authenticate a user after a successful login // Required: true IdentityToken string `json:"IdentityToken"` // The status of the authentication // Required: true Status string `json:"Status"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/versions/compare.go
vendor/github.com/docker/docker/api/types/versions/compare.go
package versions import ( "strconv" "strings" ) // compare compares two version strings // returns -1 if v1 < v2, 1 if v1 > v2, 0 otherwise. func compare(v1, v2 string) int { if v1 == v2 { return 0 } var ( currTab = strings.Split(v1, ".") otherTab = strings.Split(v2, ".") ) maxVer := len(currTab) if len(otherTab) > maxVer { maxVer = len(otherTab) } for i := 0; i < maxVer; i++ { var currInt, otherInt int if len(currTab) > i { currInt, _ = strconv.Atoi(currTab[i]) } if len(otherTab) > i { otherInt, _ = strconv.Atoi(otherTab[i]) } if currInt > otherInt { return 1 } if otherInt > currInt { return -1 } } return 0 } // LessThan checks if a version is less than another func LessThan(v, other string) bool { return compare(v, other) == -1 } // LessThanOrEqualTo checks if a version is less than or equal to another func LessThanOrEqualTo(v, other string) bool { return compare(v, other) <= 0 } // GreaterThan checks if a version is greater than another func GreaterThan(v, other string) bool { return compare(v, other) == 1 } // GreaterThanOrEqualTo checks if a version is greater than or equal to another func GreaterThanOrEqualTo(v, other string) bool { return compare(v, other) >= 0 } // Equal checks if a version is equal to another func Equal(v, other string) bool { return compare(v, other) == 0 }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/volume/volume.go
vendor/github.com/docker/docker/api/types/volume/volume.go
package volume // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // Volume volume // swagger:model Volume type Volume struct { // cluster volume ClusterVolume *ClusterVolume `json:"ClusterVolume,omitempty"` // Date/Time the volume was created. CreatedAt string `json:"CreatedAt,omitempty"` // Name of the volume driver used by the volume. // Required: true Driver string `json:"Driver"` // User-defined key/value metadata. // Required: true Labels map[string]string `json:"Labels"` // Mount path of the volume on the host. // Required: true Mountpoint string `json:"Mountpoint"` // Name of the volume. // Required: true Name string `json:"Name"` // The driver specific options used when creating the volume. // // Required: true Options map[string]string `json:"Options"` // The level at which the volume exists. Either `global` for cluster-wide, // or `local` for machine level. // // Required: true Scope string `json:"Scope"` // Low-level details about the volume, provided by the volume driver. // Details are returned as a map with key/value pairs: // `{"key":"value","key2":"value2"}`. // // The `Status` field is optional, and is omitted if the volume driver // does not support this feature. // Status map[string]interface{} `json:"Status,omitempty"` // usage data UsageData *UsageData `json:"UsageData,omitempty"` } // UsageData Usage details about the volume. This information is used by the // `GET /system/df` endpoint, and omitted in other endpoints. // // swagger:model UsageData type UsageData struct { // The number of containers referencing this volume. This field // is set to `-1` if the reference-count is not available. // // Required: true RefCount int64 `json:"RefCount"` // Amount of disk space used by the volume (in bytes). This information // is only available for volumes created with the `"local"` volume // driver. For volumes created with other volume drivers, this field // is set to `-1` ("not available") // // Required: true Size int64 `json:"Size"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/volume/cluster_volume.go
vendor/github.com/docker/docker/api/types/volume/cluster_volume.go
package volume import ( "github.com/docker/docker/api/types/swarm" ) // ClusterVolume contains options and information specific to, and only present // on, Swarm CSI cluster volumes. type ClusterVolume struct { // ID is the Swarm ID of the volume. Because cluster volumes are Swarm // objects, they have an ID, unlike non-cluster volumes, which only have a // Name. This ID can be used to refer to the cluster volume. ID string // Meta is the swarm metadata about this volume. swarm.Meta // Spec is the cluster-specific options from which this volume is derived. Spec ClusterVolumeSpec // PublishStatus contains the status of the volume as it pertains to its // publishing on Nodes. PublishStatus []*PublishStatus `json:",omitempty"` // Info is information about the global status of the volume. Info *Info `json:",omitempty"` } // ClusterVolumeSpec contains the spec used to create this volume. type ClusterVolumeSpec struct { // Group defines the volume group of this volume. Volumes belonging to the // same group can be referred to by group name when creating Services. // Referring to a volume by group instructs swarm to treat volumes in that // group interchangeably for the purpose of scheduling. Volumes with an // empty string for a group technically all belong to the same, emptystring // group. Group string `json:",omitempty"` // AccessMode defines how the volume is used by tasks. AccessMode *AccessMode `json:",omitempty"` // AccessibilityRequirements specifies where in the cluster a volume must // be accessible from. // // This field must be empty if the plugin does not support // VOLUME_ACCESSIBILITY_CONSTRAINTS capabilities. If it is present but the // plugin does not support it, volume will not be created. // // If AccessibilityRequirements is empty, but the plugin does support // VOLUME_ACCESSIBILITY_CONSTRAINTS, then Swarmkit will assume the entire // cluster is a valid target for the volume. AccessibilityRequirements *TopologyRequirement `json:",omitempty"` // CapacityRange defines the desired capacity that the volume should be // created with. If nil, the plugin will decide the capacity. CapacityRange *CapacityRange `json:",omitempty"` // Secrets defines Swarm Secrets that are passed to the CSI storage plugin // when operating on this volume. Secrets []Secret `json:",omitempty"` // Availability is the Volume's desired availability. Analogous to Node // Availability, this allows the user to take volumes offline in order to // update or delete them. Availability Availability `json:",omitempty"` } // Availability specifies the availability of the volume. type Availability string const ( // AvailabilityActive indicates that the volume is active and fully // schedulable on the cluster. AvailabilityActive Availability = "active" // AvailabilityPause indicates that no new workloads should use the // volume, but existing workloads can continue to use it. AvailabilityPause Availability = "pause" // AvailabilityDrain indicates that all workloads using this volume // should be rescheduled, and the volume unpublished from all nodes. AvailabilityDrain Availability = "drain" ) // AccessMode defines the access mode of a volume. type AccessMode struct { // Scope defines the set of nodes this volume can be used on at one time. Scope Scope `json:",omitempty"` // Sharing defines the number and way that different tasks can use this // volume at one time. Sharing SharingMode `json:",omitempty"` // MountVolume defines options for using this volume as a Mount-type // volume. // // Either BlockVolume or MountVolume, but not both, must be present. MountVolume *TypeMount `json:",omitempty"` // BlockVolume defines options for using this volume as a Block-type // volume. // // Either BlockVolume or MountVolume, but not both, must be present. BlockVolume *TypeBlock `json:",omitempty"` } // Scope defines the Scope of a Cluster Volume. This is how many nodes a // Volume can be accessed simultaneously on. type Scope string const ( // ScopeSingleNode indicates the volume can be used on one node at a // time. ScopeSingleNode Scope = "single" // ScopeMultiNode indicates the volume can be used on many nodes at // the same time. ScopeMultiNode Scope = "multi" ) // SharingMode defines the Sharing of a Cluster Volume. This is how Tasks using a // Volume at the same time can use it. type SharingMode string const ( // SharingNone indicates that only one Task may use the Volume at a // time. SharingNone SharingMode = "none" // SharingReadOnly indicates that the Volume may be shared by any // number of Tasks, but they must be read-only. SharingReadOnly SharingMode = "readonly" // SharingOneWriter indicates that the Volume may be shared by any // number of Tasks, but all after the first must be read-only. SharingOneWriter SharingMode = "onewriter" // SharingAll means that the Volume may be shared by any number of // Tasks, as readers or writers. SharingAll SharingMode = "all" ) // TypeBlock defines options for using a volume as a block-type volume. // // Intentionally empty. type TypeBlock struct{} // TypeMount contains options for using a volume as a Mount-type // volume. type TypeMount struct { // FsType specifies the filesystem type for the mount volume. Optional. FsType string `json:",omitempty"` // MountFlags defines flags to pass when mounting the volume. Optional. MountFlags []string `json:",omitempty"` } // TopologyRequirement expresses the user's requirements for a volume's // accessible topology. type TopologyRequirement struct { // Requisite specifies a list of Topologies, at least one of which the // volume must be accessible from. // // Taken verbatim from the CSI Spec: // // Specifies the list of topologies the provisioned volume MUST be // accessible from. // This field is OPTIONAL. If TopologyRequirement is specified either // requisite or preferred or both MUST be specified. // // If requisite is specified, the provisioned volume MUST be // accessible from at least one of the requisite topologies. // // Given // x = number of topologies provisioned volume is accessible from // n = number of requisite topologies // The CO MUST ensure n >= 1. The SP MUST ensure x >= 1 // If x==n, then the SP MUST make the provisioned volume available to // all topologies from the list of requisite topologies. If it is // unable to do so, the SP MUST fail the CreateVolume call. // For example, if a volume should be accessible from a single zone, // and requisite = // {"region": "R1", "zone": "Z2"} // then the provisioned volume MUST be accessible from the "region" // "R1" and the "zone" "Z2". // Similarly, if a volume should be accessible from two zones, and // requisite = // {"region": "R1", "zone": "Z2"}, // {"region": "R1", "zone": "Z3"} // then the provisioned volume MUST be accessible from the "region" // "R1" and both "zone" "Z2" and "zone" "Z3". // // If x<n, then the SP SHALL choose x unique topologies from the list // of requisite topologies. If it is unable to do so, the SP MUST fail // the CreateVolume call. // For example, if a volume should be accessible from a single zone, // and requisite = // {"region": "R1", "zone": "Z2"}, // {"region": "R1", "zone": "Z3"} // then the SP may choose to make the provisioned volume available in // either the "zone" "Z2" or the "zone" "Z3" in the "region" "R1". // Similarly, if a volume should be accessible from two zones, and // requisite = // {"region": "R1", "zone": "Z2"}, // {"region": "R1", "zone": "Z3"}, // {"region": "R1", "zone": "Z4"} // then the provisioned volume MUST be accessible from any combination // of two unique topologies: e.g. "R1/Z2" and "R1/Z3", or "R1/Z2" and // "R1/Z4", or "R1/Z3" and "R1/Z4". // // If x>n, then the SP MUST make the provisioned volume available from // all topologies from the list of requisite topologies and MAY choose // the remaining x-n unique topologies from the list of all possible // topologies. If it is unable to do so, the SP MUST fail the // CreateVolume call. // For example, if a volume should be accessible from two zones, and // requisite = // {"region": "R1", "zone": "Z2"} // then the provisioned volume MUST be accessible from the "region" // "R1" and the "zone" "Z2" and the SP may select the second zone // independently, e.g. "R1/Z4". Requisite []Topology `json:",omitempty"` // Preferred is a list of Topologies that the volume should attempt to be // provisioned in. // // Taken from the CSI spec: // // Specifies the list of topologies the CO would prefer the volume to // be provisioned in. // // This field is OPTIONAL. If TopologyRequirement is specified either // requisite or preferred or both MUST be specified. // // An SP MUST attempt to make the provisioned volume available using // the preferred topologies in order from first to last. // // If requisite is specified, all topologies in preferred list MUST // also be present in the list of requisite topologies. // // If the SP is unable to make the provisioned volume available // from any of the preferred topologies, the SP MAY choose a topology // from the list of requisite topologies. // If the list of requisite topologies is not specified, then the SP // MAY choose from the list of all possible topologies. // If the list of requisite topologies is specified and the SP is // unable to make the provisioned volume available from any of the // requisite topologies it MUST fail the CreateVolume call. // // Example 1: // Given a volume should be accessible from a single zone, and // requisite = // {"region": "R1", "zone": "Z2"}, // {"region": "R1", "zone": "Z3"} // preferred = // {"region": "R1", "zone": "Z3"} // then the SP SHOULD first attempt to make the provisioned volume // available from "zone" "Z3" in the "region" "R1" and fall back to // "zone" "Z2" in the "region" "R1" if that is not possible. // // Example 2: // Given a volume should be accessible from a single zone, and // requisite = // {"region": "R1", "zone": "Z2"}, // {"region": "R1", "zone": "Z3"}, // {"region": "R1", "zone": "Z4"}, // {"region": "R1", "zone": "Z5"} // preferred = // {"region": "R1", "zone": "Z4"}, // {"region": "R1", "zone": "Z2"} // then the SP SHOULD first attempt to make the provisioned volume // accessible from "zone" "Z4" in the "region" "R1" and fall back to // "zone" "Z2" in the "region" "R1" if that is not possible. If that // is not possible, the SP may choose between either the "zone" // "Z3" or "Z5" in the "region" "R1". // // Example 3: // Given a volume should be accessible from TWO zones (because an // opaque parameter in CreateVolumeRequest, for example, specifies // the volume is accessible from two zones, aka synchronously // replicated), and // requisite = // {"region": "R1", "zone": "Z2"}, // {"region": "R1", "zone": "Z3"}, // {"region": "R1", "zone": "Z4"}, // {"region": "R1", "zone": "Z5"} // preferred = // {"region": "R1", "zone": "Z5"}, // {"region": "R1", "zone": "Z3"} // then the SP SHOULD first attempt to make the provisioned volume // accessible from the combination of the two "zones" "Z5" and "Z3" in // the "region" "R1". If that's not possible, it should fall back to // a combination of "Z5" and other possibilities from the list of // requisite. If that's not possible, it should fall back to a // combination of "Z3" and other possibilities from the list of // requisite. If that's not possible, it should fall back to a // combination of other possibilities from the list of requisite. Preferred []Topology `json:",omitempty"` } // Topology is a map of topological domains to topological segments. // // This description is taken verbatim from the CSI Spec: // // A topological domain is a sub-division of a cluster, like "region", // "zone", "rack", etc. // A topological segment is a specific instance of a topological domain, // like "zone3", "rack3", etc. // For example {"com.company/zone": "Z1", "com.company/rack": "R3"} // Valid keys have two segments: an OPTIONAL prefix and name, separated // by a slash (/), for example: "com.company.example/zone". // The key name segment is REQUIRED. The prefix is OPTIONAL. // The key name MUST be 63 characters or less, begin and end with an // alphanumeric character ([a-z0-9A-Z]), and contain only dashes (-), // underscores (_), dots (.), or alphanumerics in between, for example // "zone". // The key prefix MUST be 63 characters or less, begin and end with a // lower-case alphanumeric character ([a-z0-9]), contain only // dashes (-), dots (.), or lower-case alphanumerics in between, and // follow domain name notation format // (https://tools.ietf.org/html/rfc1035#section-2.3.1). // The key prefix SHOULD include the plugin's host company name and/or // the plugin name, to minimize the possibility of collisions with keys // from other plugins. // If a key prefix is specified, it MUST be identical across all // topology keys returned by the SP (across all RPCs). // Keys MUST be case-insensitive. Meaning the keys "Zone" and "zone" // MUST not both exist. // Each value (topological segment) MUST contain 1 or more strings. // Each string MUST be 63 characters or less and begin and end with an // alphanumeric character with '-', '_', '.', or alphanumerics in // between. type Topology struct { Segments map[string]string `json:",omitempty"` } // CapacityRange describes the minimum and maximum capacity a volume should be // created with type CapacityRange struct { // RequiredBytes specifies that a volume must be at least this big. The // value of 0 indicates an unspecified minimum. RequiredBytes int64 // LimitBytes specifies that a volume must not be bigger than this. The // value of 0 indicates an unspecified maximum LimitBytes int64 } // Secret represents a Swarm Secret value that must be passed to the CSI // storage plugin when operating on this Volume. It represents one key-value // pair of possibly many. type Secret struct { // Key is the name of the key of the key-value pair passed to the plugin. Key string // Secret is the swarm Secret object from which to read data. This can be a // Secret name or ID. The Secret data is retrieved by Swarm and used as the // value of the key-value pair passed to the plugin. Secret string } // PublishState represents the state of a Volume as it pertains to its // use on a particular Node. type PublishState string const ( // StatePending indicates that the volume should be published on // this node, but the call to ControllerPublishVolume has not been // successfully completed yet and the result recorded by swarmkit. StatePending PublishState = "pending-publish" // StatePublished means the volume is published successfully to the node. StatePublished PublishState = "published" // StatePendingNodeUnpublish indicates that the Volume should be // unpublished on the Node, and we're waiting for confirmation that it has // done so. After the Node has confirmed that the Volume has been // unpublished, the state will move to StatePendingUnpublish. StatePendingNodeUnpublish PublishState = "pending-node-unpublish" // StatePendingUnpublish means the volume is still published to the node // by the controller, awaiting the operation to unpublish it. StatePendingUnpublish PublishState = "pending-controller-unpublish" ) // PublishStatus represents the status of the volume as published to an // individual node type PublishStatus struct { // NodeID is the ID of the swarm node this Volume is published to. NodeID string `json:",omitempty"` // State is the publish state of the volume. State PublishState `json:",omitempty"` // PublishContext is the PublishContext returned by the CSI plugin when // a volume is published. PublishContext map[string]string `json:",omitempty"` } // Info contains information about the Volume as a whole as provided by // the CSI storage plugin. type Info struct { // CapacityBytes is the capacity of the volume in bytes. A value of 0 // indicates that the capacity is unknown. CapacityBytes int64 `json:",omitempty"` // VolumeContext is the context originating from the CSI storage plugin // when the Volume is created. VolumeContext map[string]string `json:",omitempty"` // VolumeID is the ID of the Volume as seen by the CSI storage plugin. This // is distinct from the Volume's Swarm ID, which is the ID used by all of // the Docker Engine to refer to the Volume. If this field is blank, then // the Volume has not been successfully created yet. VolumeID string `json:",omitempty"` // AccessibleTopology is the topology this volume is actually accessible // from. AccessibleTopology []Topology `json:",omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/volume/volume_update.go
vendor/github.com/docker/docker/api/types/volume/volume_update.go
package volume // UpdateOptions is configuration to update a Volume with. type UpdateOptions struct { // Spec is the ClusterVolumeSpec to update the volume to. Spec *ClusterVolumeSpec `json:"Spec,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/volume/list_response.go
vendor/github.com/docker/docker/api/types/volume/list_response.go
package volume // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // ListResponse VolumeListResponse // // Volume list response // swagger:model ListResponse type ListResponse struct { // List of volumes Volumes []*Volume `json:"Volumes"` // Warnings that occurred when fetching the list of volumes. // Warnings []string `json:"Warnings"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/volume/disk_usage.go
vendor/github.com/docker/docker/api/types/volume/disk_usage.go
package volume // DiskUsage contains disk usage for volumes. // // Deprecated: this type is no longer used and will be removed in the next release. type DiskUsage struct { TotalSize int64 Reclaimable int64 Items []*Volume }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/volume/create_options.go
vendor/github.com/docker/docker/api/types/volume/create_options.go
package volume // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // CreateOptions VolumeConfig // // Volume configuration // swagger:model CreateOptions type CreateOptions struct { // cluster volume spec ClusterVolumeSpec *ClusterVolumeSpec `json:"ClusterVolumeSpec,omitempty"` // Name of the volume driver to use. Driver string `json:"Driver,omitempty"` // A mapping of driver options and values. These options are // passed directly to the driver and are driver specific. // DriverOpts map[string]string `json:"DriverOpts,omitempty"` // User-defined key/value metadata. Labels map[string]string `json:"Labels,omitempty"` // The new volume's name. If not specified, Docker generates a name. // Name string `json:"Name,omitempty"` }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/api/types/volume/options.go
vendor/github.com/docker/docker/api/types/volume/options.go
package volume import "github.com/docker/docker/api/types/filters" // ListOptions holds parameters to list volumes. type ListOptions struct { Filters filters.Args } // PruneReport contains the response for Engine API: // POST "/volumes/prune" type PruneReport struct { VolumesDeleted []string SpaceReclaimed uint64 }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/client/container_logs.go
vendor/github.com/docker/docker/client/container_logs.go
package client import ( "context" "io" "net/url" "time" "github.com/docker/docker/api/types/container" timetypes "github.com/docker/docker/api/types/time" "github.com/pkg/errors" ) // ContainerLogs returns the logs generated by a container in an io.ReadCloser. // It's up to the caller to close the stream. // // The stream format on the response will be in one of two formats: // // If the container is using a TTY, there is only a single stream (stdout), and // data is copied directly from the container output stream, no extra // multiplexing or headers. // // If the container is *not* using a TTY, streams for stdout and stderr are // multiplexed. // The format of the multiplexed stream is as follows: // // [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}[]byte{OUTPUT} // // STREAM_TYPE can be 1 for stdout and 2 for stderr // // SIZE1, SIZE2, SIZE3, and SIZE4 are four bytes of uint32 encoded as big endian. // This is the size of OUTPUT. // // You can use github.com/docker/docker/pkg/stdcopy.StdCopy to demultiplex this // stream. func (cli *Client) ContainerLogs(ctx context.Context, containerID string, options container.LogsOptions) (io.ReadCloser, error) { containerID, err := trimID("container", containerID) if err != nil { return nil, err } query := url.Values{} if options.ShowStdout { query.Set("stdout", "1") } if options.ShowStderr { query.Set("stderr", "1") } if options.Since != "" { ts, err := timetypes.GetTimestamp(options.Since, time.Now()) if err != nil { return nil, errors.Wrap(err, `invalid value for "since"`) } query.Set("since", ts) } if options.Until != "" { ts, err := timetypes.GetTimestamp(options.Until, time.Now()) if err != nil { return nil, errors.Wrap(err, `invalid value for "until"`) } query.Set("until", ts) } if options.Timestamps { query.Set("timestamps", "1") } if options.Details { query.Set("details", "1") } if options.Follow { query.Set("follow", "1") } query.Set("tail", options.Tail) resp, err := cli.get(ctx, "/containers/"+containerID+"/logs", query, nil) if err != nil { return nil, err } return resp.Body, nil }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/client/request.go
vendor/github.com/docker/docker/client/request.go
package client import ( "bytes" "context" "encoding/json" "fmt" "io" "net" "net/http" "net/url" "os" "reflect" "strings" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/versions" "github.com/pkg/errors" ) // head sends an http request to the docker API using the method HEAD. func (cli *Client) head(ctx context.Context, path string, query url.Values, headers http.Header) (*http.Response, error) { return cli.sendRequest(ctx, http.MethodHead, path, query, nil, headers) } // get sends an http request to the docker API using the method GET with a specific Go context. func (cli *Client) get(ctx context.Context, path string, query url.Values, headers http.Header) (*http.Response, error) { return cli.sendRequest(ctx, http.MethodGet, path, query, nil, headers) } // post sends an http request to the docker API using the method POST with a specific Go context. func (cli *Client) post(ctx context.Context, path string, query url.Values, obj interface{}, headers http.Header) (*http.Response, error) { body, headers, err := encodeBody(obj, headers) if err != nil { return nil, err } return cli.sendRequest(ctx, http.MethodPost, path, query, body, headers) } func (cli *Client) postRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers http.Header) (*http.Response, error) { return cli.sendRequest(ctx, http.MethodPost, path, query, body, headers) } func (cli *Client) put(ctx context.Context, path string, query url.Values, obj interface{}, headers http.Header) (*http.Response, error) { body, headers, err := encodeBody(obj, headers) if err != nil { return nil, err } return cli.putRaw(ctx, path, query, body, headers) } // putRaw sends an http request to the docker API using the method PUT. func (cli *Client) putRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers http.Header) (*http.Response, error) { // PUT requests are expected to always have a body (apparently) // so explicitly pass an empty body to sendRequest to signal that // it should set the Content-Type header if not already present. if body == nil { body = http.NoBody } return cli.sendRequest(ctx, http.MethodPut, path, query, body, headers) } // delete sends an http request to the docker API using the method DELETE. func (cli *Client) delete(ctx context.Context, path string, query url.Values, headers http.Header) (*http.Response, error) { return cli.sendRequest(ctx, http.MethodDelete, path, query, nil, headers) } func encodeBody(obj interface{}, headers http.Header) (io.Reader, http.Header, error) { if obj == nil { return nil, headers, nil } // encoding/json encodes a nil pointer as the JSON document `null`, // irrespective of whether the type implements json.Marshaler or encoding.TextMarshaler. // That is almost certainly not what the caller intended as the request body. if reflect.TypeOf(obj).Kind() == reflect.Ptr && reflect.ValueOf(obj).IsNil() { return nil, headers, nil } body, err := encodeData(obj) if err != nil { return nil, headers, err } if headers == nil { headers = make(map[string][]string) } headers["Content-Type"] = []string{"application/json"} return body, headers, nil } func (cli *Client) buildRequest(ctx context.Context, method, path string, body io.Reader, headers http.Header) (*http.Request, error) { req, err := http.NewRequestWithContext(ctx, method, path, body) if err != nil { return nil, err } req = cli.addHeaders(req, headers) req.URL.Scheme = cli.scheme req.URL.Host = cli.addr if cli.proto == "unix" || cli.proto == "npipe" { // Override host header for non-tcp connections. req.Host = DummyHost } if body != nil && req.Header.Get("Content-Type") == "" { req.Header.Set("Content-Type", "text/plain") } return req, nil } func (cli *Client) sendRequest(ctx context.Context, method, path string, query url.Values, body io.Reader, headers http.Header) (*http.Response, error) { req, err := cli.buildRequest(ctx, method, cli.getAPIPath(ctx, path, query), body, headers) if err != nil { return nil, err } resp, err := cli.doRequest(req) switch { case errors.Is(err, context.Canceled), errors.Is(err, context.DeadlineExceeded): return nil, err case err == nil: return resp, cli.checkResponseErr(resp) default: return resp, err } } func (cli *Client) doRequest(req *http.Request) (*http.Response, error) { resp, err := cli.client.Do(req) if err != nil { if cli.scheme != "https" && strings.Contains(err.Error(), "malformed HTTP response") { return nil, errConnectionFailed{fmt.Errorf("%v.\n* Are you trying to connect to a TLS-enabled daemon without TLS?", err)} } if cli.scheme == "https" && strings.Contains(err.Error(), "bad certificate") { return nil, errConnectionFailed{errors.Wrap(err, "the server probably has client authentication (--tlsverify) enabled; check your TLS client certification settings")} } // Don't decorate context sentinel errors; users may be comparing to // them directly. if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { return nil, err } var uErr *url.Error if errors.As(err, &uErr) { var nErr *net.OpError if errors.As(uErr.Err, &nErr) { if os.IsPermission(nErr.Err) { return nil, errConnectionFailed{errors.Wrapf(err, "permission denied while trying to connect to the Docker daemon socket at %v", cli.host)} } } } var nErr net.Error if errors.As(err, &nErr) { // FIXME(thaJeztah): any net.Error should be considered a connection error (but we should include the original error)? if nErr.Timeout() { return nil, connectionFailed(cli.host) } if strings.Contains(nErr.Error(), "connection refused") || strings.Contains(nErr.Error(), "dial unix") { return nil, connectionFailed(cli.host) } } // Although there's not a strongly typed error for this in go-winio, // lots of people are using the default configuration for the docker // daemon on Windows where the daemon is listening on a named pipe // `//./pipe/docker_engine, and the client must be running elevated. // Give users a clue rather than the not-overly useful message // such as `error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/info: // open //./pipe/docker_engine: The system cannot find the file specified.`. // Note we can't string compare "The system cannot find the file specified" as // this is localised - for example in French the error would be // `open //./pipe/docker_engine: Le fichier spécifié est introuvable.` if strings.Contains(err.Error(), `open //./pipe/docker_engine`) { // Checks if client is running with elevated privileges if f, elevatedErr := os.Open(`\\.\PHYSICALDRIVE0`); elevatedErr != nil { err = errors.Wrap(err, "in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect") } else { _ = f.Close() err = errors.Wrap(err, "this error may indicate that the docker daemon is not running") } } return nil, errConnectionFailed{errors.Wrap(err, "error during connect")} } return resp, nil } func (cli *Client) checkResponseErr(serverResp *http.Response) (retErr error) { if serverResp == nil { return nil } if serverResp.StatusCode >= http.StatusOK && serverResp.StatusCode < http.StatusBadRequest { return nil } defer func() { retErr = httpErrorFromStatusCode(retErr, serverResp.StatusCode) }() var body []byte var err error var reqURL string if serverResp.Request != nil { reqURL = serverResp.Request.URL.String() } statusMsg := serverResp.Status if statusMsg == "" { statusMsg = http.StatusText(serverResp.StatusCode) } if serverResp.Body != nil { bodyMax := 1 * 1024 * 1024 // 1 MiB bodyR := &io.LimitedReader{ R: serverResp.Body, N: int64(bodyMax), } body, err = io.ReadAll(bodyR) if err != nil { return err } if bodyR.N == 0 { if reqURL != "" { return fmt.Errorf("request returned %s with a message (> %d bytes) for API route and version %s, check if the server supports the requested API version", statusMsg, bodyMax, reqURL) } return fmt.Errorf("request returned %s with a message (> %d bytes); check if the server supports the requested API version", statusMsg, bodyMax) } } if len(body) == 0 { if reqURL != "" { return fmt.Errorf("request returned %s for API route and version %s, check if the server supports the requested API version", statusMsg, reqURL) } return fmt.Errorf("request returned %s; check if the server supports the requested API version", statusMsg) } var daemonErr error if serverResp.Header.Get("Content-Type") == "application/json" { var errorResponse types.ErrorResponse if err := json.Unmarshal(body, &errorResponse); err != nil { return errors.Wrap(err, "Error reading JSON") } if errorResponse.Message == "" { // Error-message is empty, which means that we successfully parsed the // JSON-response (no error produced), but it didn't contain an error // message. This could either be because the response was empty, or // the response was valid JSON, but not with the expected schema // ([types.ErrorResponse]). // // We cannot use "strict" JSON handling (json.NewDecoder with DisallowUnknownFields) // due to the API using an open schema (we must anticipate fields // being added to [types.ErrorResponse] in the future, and not // reject those responses. // // For these cases, we construct an error with the status-code // returned, but we could consider returning (a truncated version // of) the actual response as-is. // // TODO(thaJeztah): consider adding a log.Debug to allow clients to debug the actual response when enabling debug logging. daemonErr = fmt.Errorf(`API returned a %d (%s) but provided no error-message`, serverResp.StatusCode, http.StatusText(serverResp.StatusCode), ) } else { daemonErr = errors.New(strings.TrimSpace(errorResponse.Message)) } } else { // Fall back to returning the response as-is for API versions < 1.24 // that didn't support JSON error responses, and for situations // where a plain text error is returned. This branch may also catch // situations where a proxy is involved, returning a HTML response. daemonErr = errors.New(strings.TrimSpace(string(body))) } return errors.Wrap(daemonErr, "Error response from daemon") } func (cli *Client) addHeaders(req *http.Request, headers http.Header) *http.Request { // Add CLI Config's HTTP Headers BEFORE we set the Docker headers // then the user can't change OUR headers for k, v := range cli.customHTTPHeaders { if versions.LessThan(cli.version, "1.25") && http.CanonicalHeaderKey(k) == "User-Agent" { continue } req.Header.Set(k, v) } for k, v := range headers { req.Header[http.CanonicalHeaderKey(k)] = v } if cli.userAgent != nil { if *cli.userAgent == "" { req.Header.Del("User-Agent") } else { req.Header.Set("User-Agent", *cli.userAgent) } } return req } func encodeData(data interface{}) (*bytes.Buffer, error) { params := bytes.NewBuffer(nil) if data != nil { if err := json.NewEncoder(params).Encode(data); err != nil { return nil, err } } return params, nil } func ensureReaderClosed(response *http.Response) { if response != nil && response.Body != nil { // Drain up to 512 bytes and close the body to let the Transport reuse the connection // see https://github.com/google/go-github/pull/317/files#r57536827 // // TODO(thaJeztah): see if this optimization is still needed, or already implemented in stdlib, // and check if context-cancellation should handle this as well. If still needed, consider // wrapping response.Body, or returning a "closer()" from [Client.sendRequest] and related // methods. _, _ = io.CopyN(io.Discard, response.Body, 512) _ = response.Body.Close() } }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/client/image_import.go
vendor/github.com/docker/docker/client/image_import.go
package client import ( "context" "io" "net/url" "strings" "github.com/distribution/reference" "github.com/docker/docker/api/types/image" ) // ImageImport creates a new image based on the source options. // It returns the JSON content in the response body. func (cli *Client) ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { if ref != "" { // Check if the given image name can be resolved if _, err := reference.ParseNormalizedNamed(ref); err != nil { return nil, err } } query := url.Values{} if source.SourceName != "" { query.Set("fromSrc", source.SourceName) } if ref != "" { query.Set("repo", ref) } if options.Tag != "" { query.Set("tag", options.Tag) } if options.Message != "" { query.Set("message", options.Message) } if options.Platform != "" { query.Set("platform", strings.ToLower(options.Platform)) } for _, change := range options.Changes { query.Add("changes", change) } resp, err := cli.postRaw(ctx, "/images/create", query, source.Source, nil) if err != nil { return nil, err } return resp.Body, nil }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false
jesseduffield/lazydocker
https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/github.com/docker/docker/client/plugin_push.go
vendor/github.com/docker/docker/client/plugin_push.go
package client import ( "context" "io" "net/http" "github.com/docker/docker/api/types/registry" ) // PluginPush pushes a plugin to a registry func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) { name, err := trimID("plugin", name) if err != nil { return nil, err } resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, http.Header{ registry.AuthHeader: {registryAuth}, }) if err != nil { return nil, err } return resp.Body, nil }
go
MIT
f4fc3669ca8eb67aa350a76503397192bf26f057
2026-01-07T08:35:43.570558Z
false