Documentation
¶
Index ¶
- Constants
- func SplitStream(stream io.Reader, stdout, stderr io.Writer) error
- type AttachOptions
- type AuthConfig
- type BlkioStatEntry
- type BlkioStats
- type ChangeType
- type Client
- func (client *Client) Attach(cid string, options *AttachOptions) (io.ReadCloser, error)
- func (client *Client) Changes(cid string) ([]ContainerChange, error)
- func (client *Client) Commit(options *CommitOptions, config *ContainerConfig) (string, error)
- func (client *Client) ContainerLogs(id string, options *LogOptions) (io.ReadCloser, error)
- func (client *Client) Copy(cid, resource string) (TarReader, error)
- func (client *Client) CreateContainer(config *ContainerConfig, name string) (string, error)
- func (client *Client) DoRequest(method string, path string, body io.Reader) (*http.Response, error)
- func (client *Client) Exec(config *ExecConfig) (string, error)
- func (client *Client) History(id string) ([]ImageLayer, error)
- func (client *Client) Info() (*Info, error)
- func (client *Client) InspectContainer(id string) (*ContainerInfo, error)
- func (client *Client) InspectImage(name string) (ImageInfo, error)
- func (client *Client) KillContainer(id, signal string) error
- func (client *Client) ListContainers(all bool, size bool, filters string) ([]Container, error)
- func (client *Client) ListImages(all bool) ([]*Image, error)
- func (client *Client) LoadImage(reader io.Reader) error
- func (client *Client) MonitorStats(id string) (*Stats, error)
- func (client *Client) NewRequest(method string, path string, body io.Reader) (*http.Request, error)
- func (client *Client) PauseContainer(id string) error
- func (client *Client) PullImage(name string, auth *AuthConfig) error
- func (client *Client) Push(name, tag string, auth *AuthConfig) error
- func (client *Client) RemoveContainer(id string, force, volumes bool) error
- func (client *Client) RemoveImage(name string) ([]*ImageDelete, error)
- func (client *Client) RestartContainer(id string, timeout int) error
- func (client *Client) StartContainer(id string, config *HostConfig) error
- func (client *Client) StopContainer(id string, timeout int) error
- func (client *Client) Tag(imgId string, ops *TagOptions) error
- func (client *Client) UnpauseContainer(id string) error
- func (client *Client) Version() (*Version, error)
- func (client *Client) Wait(cid string) (int, error)
- type CommitOptions
- type Container
- type ContainerChange
- type ContainerConfig
- type ContainerInfo
- type CpuStats
- type CpuUsage
- type Error
- type Event
- type ExecConfig
- type HostConfig
- type Image
- type ImageDelete
- type ImageInfo
- type ImageLayer
- type Info
- type LogOptions
- type MemDetails
- type MemoryStats
- type NetworkStats
- type Port
- type PortBinding
- type RespContainersCreate
- type RestartPolicy
- type Stats
- type TagOptions
- type TarReader
- type ThrottlingData
- type Version
Constants ¶
const ( StdinStream byte = 0 StdoutStream = 1 StderrStream = 2 )
const ( ChangeModify = iota ChangeAdd ChangeDelete )
const APIVersion = "v1.17"
Variables ¶
This section is empty.
Functions ¶
func SplitStream ¶
SplitStream splits docker stream data into stdout and stderr. For specifications see http://goo.gl/Dnbcye
Types ¶
type AttachOptions ¶
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 ChangeType ¶
type ChangeType int
type Client ¶
func NewDefaultClient ¶
NewDefaultClient provides an arch specific default docker client. On linux it connects to the default docker socket, on OS X it looks for boot2docker environment variables.
func (*Client) Attach ¶
func (client *Client) Attach(cid string, options *AttachOptions) (io.ReadCloser, error)
Attach returns the stdout and stderr stream of a stopped or running container. It is the callers responsibility to close the returned stream. Use SplitStream to parse stdout and stderr.
func (*Client) Changes ¶
func (client *Client) Changes(cid string) ([]ContainerChange, error)
Changes provides a list of changes made to a container.
func (*Client) Commit ¶
func (client *Client) Commit(options *CommitOptions, config *ContainerConfig) (string, error)
func (*Client) ContainerLogs ¶
func (client *Client) ContainerLogs(id string, options *LogOptions) (io.ReadCloser, error)
func (*Client) Copy ¶
Copy copies files or folders from a container. It is the caller's responsiblity to call Close on returned TarReader.
func (*Client) CreateContainer ¶
func (client *Client) CreateContainer(config *ContainerConfig, name string) (string, error)
func (*Client) InspectContainer ¶
func (client *Client) InspectContainer(id string) (*ContainerInfo, error)
func (*Client) KillContainer ¶
func (*Client) ListContainers ¶
func (*Client) NewRequest ¶
func (*Client) PauseContainer ¶
func (*Client) RemoveContainer ¶
func (*Client) RemoveImage ¶
func (client *Client) RemoveImage(name string) ([]*ImageDelete, error)
func (*Client) RestartContainer ¶
func (*Client) StartContainer ¶
func (client *Client) StartContainer(id string, config *HostConfig) error
func (*Client) UnpauseContainer ¶
type CommitOptions ¶
type ContainerChange ¶
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
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 struct {
Running bool
Paused bool
Restarting bool
Pid int
ExitCode int
StartedAt time.Time
FinishedAt time.Time
Ghost bool
}
Image string
NetworkSettings struct {
IpAddress string
IpPrefixLen int
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 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
NetworkMode string
RestartPolicy RestartPolicy
Memory int64
MemorySwap int64
CpuPeriod int64
CpusetCpus string
CpusetMems string
}
type ImageDelete ¶
type ImageLayer ¶
type ImageLayer struct {
Id string
Created int64
CreatedBy string
Comment string
Size int64
Tags []string
}
returned by History
type LogOptions ¶
type MemDetails ¶
type MemDetails struct {
TotalPgmajFault uint64 `json:"total_pgmajfault"`
Cache uint64 `json:"cache"`
MappedFile uint64 `json:"mapped_file"`
TotalInactiveFile uint64 `json:"total_inactive_file"`
PgpgOut uint64 `json:"pgpgout"`
Rss uint64 `json:"rss"`
TotalMappedFile uint64 `json:"total_mapped_file"`
Writeback uint64 `json:"writeback"`
Unevictable uint64 `json:"unevictable"`
PgpgIn uint64 `json:"pgpgin"`
TotalUnevictable uint64 `json:"total_unevictable"`
PgmajFault uint64 `json:"pgmajfault"`
TotalRss uint64 `json:"total_rss"`
TotalRssHuge uint64 `json:"total_rss_huge"`
TotalWriteback uint64 `json:"total_writeback"`
TotalInactiveAnon uint64 `json:"total_inactive_anon"`
RssHuge uint64 `json:"rss_huge"`
HierarchicalMemoryLimit uint64 `json:"hierarchical_memory_limit"`
TotalPgFault uint64 `json:"total_pgfault"`
TotalActiveFile uint64 `json:"total_active_file"`
ActiveAnon uint64 `json:"active_anon"`
TotalActiveAnon uint64 `json:"total_active_anon"`
TotalPgpgOut uint64 `json:"total_pgpgout"`
TotalCache uint64 `json:"total_cache"`
InactiveAnon uint64 `json:"inactive_anon"`
ActiveFile uint64 `json:"active_file"`
PgFault uint64 `json:"pgfault"`
InactiveFile uint64 `json:"inactive_file"`
TotalPgpgIn uint64 `json:"total_pgpgin"`
}
type MemoryStats ¶
type MemoryStats struct {
Usage uint64 `json:"usage"`
MaxUsage uint64 `json:"max_usage"`
Stats MemDetails `json:"stats"`
Failcnt uint64 `json:"failcnt"`
Limit uint64 `json:"limit"`
}
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 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 TagOptions ¶
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"`
}
