Documentation ¶
Index ¶
- Constants
- Variables
- type AuthConfig
- type BlkioStatEntry
- type BlkioStats
- type Callback
- type Client
- type Container
- type ContainerChanges
- type ContainerConfig
- type ContainerInfo
- type CpuStats
- type CpuUsage
- type DockerClient
- func (client *DockerClient) ContainerChanges(id string) ([]*ContainerChanges, error)
- func (client *DockerClient) ContainerLogs(id string, options *LogOptions) (io.ReadCloser, error)
- func (client *DockerClient) CreateContainer(config *ContainerConfig, name string) (string, error)
- func (client *DockerClient) Exec(config *ExecConfig) (string, error)
- func (client *DockerClient) ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error)
- func (client *DockerClient) Info() (*Info, error)
- func (client *DockerClient) InspectContainer(id string) (*ContainerInfo, error)
- func (client *DockerClient) KillContainer(id, signal string) error
- func (client *DockerClient) ListContainers(all bool, size bool, filters string) ([]Container, error)
- func (client *DockerClient) ListImages() ([]*Image, error)
- func (client *DockerClient) LoadImage(reader io.Reader) error
- func (client *DockerClient) PauseContainer(id string) error
- func (client *DockerClient) PullImage(name string, auth *AuthConfig) error
- func (client *DockerClient) RemoveContainer(id string, force, volumes bool) error
- func (client *DockerClient) RemoveImage(name string) ([]*ImageDelete, error)
- func (client *DockerClient) RenameContainer(oldName string, newName string) error
- func (client *DockerClient) RestartContainer(id string, timeout int) error
- func (client *DockerClient) StartContainer(id string, config *HostConfig) error
- func (client *DockerClient) StartMonitorEvents(cb Callback, ec chan error, args ...interface{})
- func (client *DockerClient) StartMonitorStats(id string, cb StatCallback, ec chan error, args ...interface{})
- func (client *DockerClient) StopAllMonitorEvents()
- func (client *DockerClient) StopAllMonitorStats()
- func (client *DockerClient) StopContainer(id string, timeout int) error
- func (client *DockerClient) TagImage(nameOrID string, repo string, tag string, force bool) error
- func (client *DockerClient) UnpauseContainer(id string) error
- func (client *DockerClient) Version() (*Version, error)
- type Error
- type Event
- type ExecConfig
- type HostConfig
- type Image
- type ImageDelete
- type Info
- type LogConfig
- type LogOptions
- type MemoryStats
- type NetworkStats
- type Port
- type PortBinding
- type RespContainersCreate
- type RestartPolicy
- type StatCallback
- type State
- type Stats
- type ThrottlingData
- type Ulimit
- type Version
Constants ¶
View Source
const (
APIVersion = "v1.15"
)
Variables ¶
View Source
var (
ErrNotFound = errors.New("Not found")
)
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Email string `json:"email,omitempty"` }
AuthConfig hold parameters for authenticating with the docker registry
type BlkioStatEntry ¶
type BlkioStats ¶
type BlkioStats struct { // number of bytes tranferred 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"` }
type Client ¶
type Client interface { Info() (*Info, error) ListContainers(all, size bool, filters string) ([]Container, error) InspectContainer(id string) (*ContainerInfo, error) CreateContainer(config *ContainerConfig, name string) (string, error) ContainerLogs(id string, options *LogOptions) (io.ReadCloser, error) ContainerChanges(id string) ([]*ContainerChanges, error) Exec(config *ExecConfig) (string, error) StartContainer(id string, config *HostConfig) error StopContainer(id string, timeout int) error RestartContainer(id string, timeout int) error KillContainer(id, signal string) error StartMonitorEvents(cb Callback, ec chan error, args ...interface{}) StopAllMonitorEvents() StartMonitorStats(id string, cb StatCallback, ec chan error, args ...interface{}) StopAllMonitorStats() TagImage(nameOrID string, repo string, tag string, force bool) error Version() (*Version, error) PullImage(name string, auth *AuthConfig) error LoadImage(reader io.Reader) error RemoveContainer(id string, force, volumes bool) error ListImages() ([]*Image, error) RemoveImage(name string) ([]*ImageDelete, error) PauseContainer(name string) error UnpauseContainer(name string) error RenameContainer(oldName string, newName string) error ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error) }
type ContainerChanges ¶
type ContainerConfig ¶
type ContainerConfig struct { Hostname string Domainname string User string Memory int64 MemorySwap int64 Cpuset string AttachStdin bool AttachStdout bool AttachStderr bool PortSpecs []string ExposedPorts map[string]struct{} Tty bool OpenStdin bool StdinOnce bool Env []string Cmd []string Image string Labels map[string]string Volumes map[string]struct{} WorkingDir string Entrypoint []string NetworkDisabled bool OnBuild []string // This is used only by the create command HostConfig HostConfig }
type ContainerInfo ¶
type ContainerInfo struct { Id string Created string Path string Name string Args []string ExecIDs []string Config *ContainerConfig State *State Image string NetworkSettings struct { IPAddress string `json:"IpAddress"` IPPrefixLen int `json:"IpPrefixLen"` Gateway string Bridge string Ports map[string][]PortBinding } SysInitPath string ResolvConfPath string Volumes map[string]string HostConfig *HostConfig }
type CpuStats ¶
type CpuStats struct { CpuUsage CpuUsage `json:"cpu_usage"` SystemUsage uint64 `json:"system_cpu_usage"` ThrottlingData ThrottlingData `json:"throttling_data,omitempty"` }
type CpuUsage ¶
type CpuUsage struct { // Total CPU time consumed. // Units: nanoseconds. TotalUsage uint64 `json:"total_usage"` // Total CPU time consumed per core. // Units: nanoseconds. PercpuUsage []uint64 `json:"percpu_usage"` // Time spent by tasks of the cgroup in kernel mode. // Units: nanoseconds. UsageInKernelmode uint64 `json:"usage_in_kernelmode"` // Time spent by tasks of the cgroup in user mode. // Units: nanoseconds. UsageInUsermode uint64 `json:"usage_in_usermode"` }
type DockerClient ¶
type DockerClient struct { URL *url.URL HTTPClient *http.Client TLSConfig *tls.Config // contains filtered or unexported fields }
func NewDockerClient ¶
func NewDockerClient(daemonUrl string, tlsConfig *tls.Config) (*DockerClient, error)
func NewDockerClientTimeout ¶
func (*DockerClient) ContainerChanges ¶
func (client *DockerClient) ContainerChanges(id string) ([]*ContainerChanges, error)
func (*DockerClient) ContainerLogs ¶
func (client *DockerClient) ContainerLogs(id string, options *LogOptions) (io.ReadCloser, error)
func (*DockerClient) CreateContainer ¶
func (client *DockerClient) CreateContainer(config *ContainerConfig, name string) (string, error)
func (*DockerClient) Exec ¶
func (client *DockerClient) Exec(config *ExecConfig) (string, error)
func (*DockerClient) ImportImage ¶
func (client *DockerClient) ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error)
func (*DockerClient) Info ¶
func (client *DockerClient) Info() (*Info, error)
func (*DockerClient) InspectContainer ¶
func (client *DockerClient) InspectContainer(id string) (*ContainerInfo, error)
func (*DockerClient) KillContainer ¶
func (client *DockerClient) KillContainer(id, signal string) error
func (*DockerClient) ListContainers ¶
func (*DockerClient) ListImages ¶
func (client *DockerClient) ListImages() ([]*Image, error)
func (*DockerClient) PauseContainer ¶
func (client *DockerClient) PauseContainer(id string) error
func (*DockerClient) PullImage ¶
func (client *DockerClient) PullImage(name string, auth *AuthConfig) error
func (*DockerClient) RemoveContainer ¶
func (client *DockerClient) RemoveContainer(id string, force, volumes bool) error
func (*DockerClient) RemoveImage ¶
func (client *DockerClient) RemoveImage(name string) ([]*ImageDelete, error)
func (*DockerClient) RenameContainer ¶
func (client *DockerClient) RenameContainer(oldName string, newName string) error
func (*DockerClient) RestartContainer ¶
func (client *DockerClient) RestartContainer(id string, timeout int) error
func (*DockerClient) StartContainer ¶
func (client *DockerClient) StartContainer(id string, config *HostConfig) error
func (*DockerClient) StartMonitorEvents ¶
func (client *DockerClient) StartMonitorEvents(cb Callback, ec chan error, args ...interface{})
func (*DockerClient) StartMonitorStats ¶
func (client *DockerClient) StartMonitorStats(id string, cb StatCallback, ec chan error, args ...interface{})
func (*DockerClient) StopAllMonitorEvents ¶
func (client *DockerClient) StopAllMonitorEvents()
func (*DockerClient) StopAllMonitorStats ¶
func (client *DockerClient) StopAllMonitorStats()
func (*DockerClient) StopContainer ¶
func (client *DockerClient) StopContainer(id string, timeout int) error
func (*DockerClient) UnpauseContainer ¶
func (client *DockerClient) UnpauseContainer(id string) error
func (*DockerClient) Version ¶
func (client *DockerClient) Version() (*Version, error)
type ExecConfig ¶
type HostConfig ¶
type HostConfig struct { Binds []string ContainerIDFile string LxcConf []map[string]string Privileged bool PortBindings map[string][]PortBinding Links []string PublishAllPorts bool Dns []string DnsSearch []string VolumesFrom []string SecurityOpt []string NetworkMode string RestartPolicy RestartPolicy Ulimits []Ulimit LogConfig LogConfig }
type ImageDelete ¶
type LogOptions ¶
type MemoryStats ¶
type NetworkStats ¶
type NetworkStats struct { RxBytes uint64 `json:"rx_bytes"` RxPackets uint64 `json:"rx_packets"` RxErrors uint64 `json:"rx_errors"` RxDropped uint64 `json:"rx_dropped"` TxBytes uint64 `json:"tx_bytes"` TxPackets uint64 `json:"tx_packets"` TxErrors uint64 `json:"tx_errors"` TxDropped uint64 `json:"tx_dropped"` }
type PortBinding ¶
type RespContainersCreate ¶
type RestartPolicy ¶
type StatCallback ¶
type State ¶
type State struct { Running bool Paused bool Restarting bool OOMKilled bool Dead bool Pid int ExitCode int Error string // contains last known error when starting the container StartedAt time.Time FinishedAt time.Time Ghost bool }
func (*State) StateString ¶
StateString returns a single string to describe state Stoken from docker/docker/daemon/state.go
type Stats ¶
type Stats struct { Read time.Time `json:"read"` NetworkStats NetworkStats `json:"network,omitempty"` CpuStats CpuStats `json:"cpu_stats,omitempty"` MemoryStats MemoryStats `json:"memory_stats,omitempty"` BlkioStats BlkioStats `json:"blkio_stats,omitempty"` }
type ThrottlingData ¶
type ThrottlingData struct { // Number of periods with throttling active Periods uint64 `json:"periods"` // Number of periods when the container hit its throttling limit. ThrottledPeriods uint64 `json:"throttled_periods"` // Aggregate time the container was throttled for in nanoseconds. ThrottledTime uint64 `json:"throttled_time"` }
The following are types for the API stats endpoint
Source Files ¶
Click to show internal directories.
Click to hide internal directories.