dockerclient: github.com/samalba/dockerclient Index | Examples | Files | Directories

package dockerclient

import "github.com/samalba/dockerclient"

Index

Examples

Package Files

auth.go dockerclient.go example_responses.go interface.go tls.go types.go utils.go

Constants

const (
    // APIVersion is currently hardcoded to v1.15
    // TODO: bump the API version or allow users to choose which API version to
    // use the client with. The current value does not make sense for many
    // methods, such as ContainerStats, StartMonitorStats, and StopAllMonitorStats
    // (v1.17) and
    // ListVolumes, {Remove,Create}Volume, ListNetworks,
    // {Inspect,Create,Connect,Disconnect,Remove}Network (v1.21)
    APIVersion = "v1.15"
)

Variables

var (
    ErrImageNotFound     = errors.New("Image not found")
    ErrNotFound          = errors.New("Not found")
    ErrConnectionRefused = errors.New("Cannot connect to the docker engine endpoint")
)

func TLSConfigFromCertPath Uses

func TLSConfigFromCertPath(path string) (*tls.Config, error)

TLSConfigFromCertPath returns a configuration based on PEM files in the directory

path is usually what is set by the environment variable `DOCKER_CERT_PATH`, or `$HOME/.docker`.

type Actor Uses

type Actor struct {
    ID         string
    Attributes map[string]string
}

type AttachOptions Uses

type AttachOptions struct {
    Logs   bool
    Stream bool
    Stdin  bool
    Stdout bool
    Stderr bool
}

type AuthConfig Uses

type AuthConfig struct {
    Username      string `json:"username,omitempty"`
    Password      string `json:"password,omitempty"`
    Email         string `json:"email,omitempty"`
    RegistryToken string `json:"registrytoken,omitempty"`
}

AuthConfig hold parameters for authenticating with the docker registry

type BlkioStatEntry Uses

type BlkioStatEntry struct {
    Major uint64 `json:"major"`
    Minor uint64 `json:"minor"`
    Op    string `json:"op"`
    Value uint64 `json:"value"`
}

type BlkioStats Uses

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 BuildImage Uses

type BuildImage struct {
    Config         *ConfigFile
    DockerfileName string
    Context        io.Reader
    RemoteURL      string
    RepoName       string
    SuppressOutput bool
    NoCache        bool
    Remove         bool
    ForceRemove    bool
    Pull           bool
    Memory         int64
    MemorySwap     int64
    CpuShares      int64
    CpuPeriod      int64
    CpuQuota       int64
    CpuSetCpus     string
    CpuSetMems     string
    CgroupParent   string
    BuildArgs      map[string]string
    Labels         map[string]string // Labels hold metadata about the image
}

type Callback Uses

type Callback func(*Event, chan error, ...interface{})

type Client Uses

type Client interface {
    Info() (*Info, error)
    ListContainers(all, size bool, filters string) ([]Container, error)
    InspectContainer(id string) (*ContainerInfo, error)
    InspectImage(id string) (*ImageInfo, error)
    CreateContainer(config *ContainerConfig, name string, authConfig *AuthConfig) (string, error)
    ContainerLogs(id string, options *LogOptions) (io.ReadCloser, error)
    ContainerChanges(id string) ([]*ContainerChanges, error)
    // ContainerStats takes a container ID and an optional stop channel and
    // returns a StatsOrError channel. If an error is ever sent, then no
    // more stats will be sent on that channel. If a stop channel is
    // provided, events will stop being monitored after the stop channel is
    // closed.
    ContainerStats(id string, stopChan <-chan struct{}) (<-chan StatsOrError, error)
    ExecCreate(config *ExecConfig) (string, error)
    ExecStart(id string, config *ExecConfig) error
    ExecResize(id string, width, height int) error
    StartContainer(id string, config *HostConfig) error
    AttachContainer(id string, options *AttachOptions) (io.ReadCloser, error)
    StopContainer(id string, timeout int) error
    RestartContainer(id string, timeout int) error
    KillContainer(id, signal string) error
    Wait(id string) <-chan WaitResult
    // MonitorEvents takes options and an optional stop channel, and returns
    // an EventOrError channel. If an error is ever sent, then no more
    // events will be sent. If a stop channel is provided, events will stop
    // being monitored after the stop channel is closed.
    MonitorEvents(options *MonitorEventsOptions, stopChan <-chan struct{}) (<-chan EventOrError, 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
    PushImage(name string, tag string, auth *AuthConfig) error
    LoadImage(reader io.Reader) error
    RemoveContainer(id string, force, volumes bool) error
    ListImages(all bool) ([]*Image, error)
    RemoveImage(name string, force bool) ([]*ImageDelete, error)
    SearchImages(query, registry string, auth *AuthConfig) ([]ImageSearch, 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)
    BuildImage(image *BuildImage) (io.ReadCloser, error)
    ListVolumes() ([]*Volume, error)
    RemoveVolume(name string) error
    CreateVolume(request *VolumeCreateRequest) (*Volume, error)
    ListNetworks(filters string) ([]*NetworkResource, error)
    InspectNetwork(id string) (*NetworkResource, error)
    CreateNetwork(config *NetworkCreate) (*NetworkCreateResponse, error)
    ConnectNetwork(id, container string) error
    DisconnectNetwork(id, container string, force bool) error
    RemoveNetwork(id string) error
}

type ConfigFile Uses

type ConfigFile struct {
    Configs map[string]AuthConfig `json:"configs,omitempty"`
    // contains filtered or unexported fields
}

ConfigFile holds parameters for authenticating during a BuildImage request

type Container Uses

type Container struct {
    Id              string
    Names           []string
    Image           string
    Command         string
    Created         int64
    Status          string
    Ports           []Port
    SizeRw          int64
    SizeRootFs      int64
    Labels          map[string]string
    NetworkSettings struct {
        Networks map[string]EndpointSettings
    }
}

type ContainerChanges Uses

type ContainerChanges struct {
    Path string
    Kind int
}

type ContainerConfig Uses

type ContainerConfig struct {
    Hostname        string
    Domainname      string
    User            string
    AttachStdin     bool
    AttachStdout    bool
    AttachStderr    bool
    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
    MacAddress      string
    OnBuild         []string
    Labels          map[string]string
    StopSignal      string

    // FIXME: VolumeDriver have been removed since docker 1.9
    VolumeDriver string

    // FIXME: The following fields have been removed since API v1.18
    Memory     int64
    MemorySwap int64
    CpuShares  int64
    Cpuset     string
    PortSpecs  []string

    // This is used only by the create command
    HostConfig HostConfig

    // Network configuration support
    NetworkingConfig NetworkingConfig
}

type ContainerInfo Uses

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
        Networks    map[string]*EndpointSettings
    }
    SysInitPath    string
    ResolvConfPath string
    Volumes        map[string]string
    HostConfig     *HostConfig
}

type CpuStats Uses

type CpuStats struct {
    CpuUsage       CpuUsage       `json:"cpu_usage"`
    SystemUsage    uint64         `json:"system_cpu_usage"`
    ThrottlingData ThrottlingData `json:"throttling_data,omitempty"`
}

type CpuUsage Uses

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"`
}

All CPU stats are aggregated since container inception.

type DeviceMapping Uses

type DeviceMapping struct {
    PathOnHost        string `json:"PathOnHost"`
    PathInContainer   string `json:"PathInContainer"`
    CgroupPermissions string `json:"CgroupPermissions"`
}

type DockerClient Uses

type DockerClient struct {
    URL        *url.URL
    HTTPClient *http.Client
    TLSConfig  *tls.Config
    // contains filtered or unexported fields
}

func NewDockerClient Uses

func NewDockerClient(daemonUrl string, tlsConfig *tls.Config) (*DockerClient, error)

func NewDockerClientTimeout Uses

func NewDockerClientTimeout(daemonUrl string, tlsConfig *tls.Config, timeout time.Duration, setUserTimeout tcpFunc) (*DockerClient, error)

func (*DockerClient) AttachContainer Uses

func (client *DockerClient) AttachContainer(id string, options *AttachOptions) (io.ReadCloser, error)

Code:

docker, err := NewDockerClient("unix:///var/run/docker.sock", nil)
if err != nil {
    panic(err)
}
cID, err := docker.CreateContainer(&ContainerConfig{
    Cmd:   []string{"echo", "hi"},
    Image: "busybox",
}, "", nil)
if err != nil {
    panic(err)
}
done := make(chan struct{})
if body, err := docker.AttachContainer(cID, &AttachOptions{
    Stream: true,
    Stdout: true,
}); err != nil {
    panic(err)
} else {
    go func() {
        defer body.Close()
        if _, err := stdcopy.StdCopy(os.Stdout, os.Stderr, body); err != nil {
            panic(err)
        }
        close(done)
    }()
}

if err := docker.StartContainer(cID, nil); err != nil {
    panic(err)
}
<-done

func (*DockerClient) BuildImage Uses

func (client *DockerClient) BuildImage(image *BuildImage) (io.ReadCloser, error)

func (*DockerClient) ConnectNetwork Uses

func (client *DockerClient) ConnectNetwork(id, container string) error

func (*DockerClient) ContainerChanges Uses

func (client *DockerClient) ContainerChanges(id string) ([]*ContainerChanges, error)

func (*DockerClient) ContainerLogs Uses

func (client *DockerClient) ContainerLogs(id string, options *LogOptions) (io.ReadCloser, error)

func (*DockerClient) ContainerStats Uses

func (client *DockerClient) ContainerStats(id string, stopChan <-chan struct{}) (<-chan StatsOrError, error)

func (*DockerClient) CreateContainer Uses

func (client *DockerClient) CreateContainer(config *ContainerConfig, name string, auth *AuthConfig) (string, error)

func (*DockerClient) CreateNetwork Uses

func (client *DockerClient) CreateNetwork(config *NetworkCreate) (*NetworkCreateResponse, error)

func (*DockerClient) CreateVolume Uses

func (client *DockerClient) CreateVolume(request *VolumeCreateRequest) (*Volume, error)

func (*DockerClient) DisconnectNetwork Uses

func (client *DockerClient) DisconnectNetwork(id, container string, force bool) error

func (*DockerClient) ExecCreate Uses

func (client *DockerClient) ExecCreate(config *ExecConfig) (string, error)

func (*DockerClient) ExecResize Uses

func (client *DockerClient) ExecResize(id string, width, height int) error

func (*DockerClient) ExecStart Uses

func (client *DockerClient) ExecStart(id string, config *ExecConfig) error

func (*DockerClient) ImportImage Uses

func (client *DockerClient) ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error)

func (*DockerClient) Info Uses

func (client *DockerClient) Info() (*Info, error)

func (*DockerClient) InspectContainer Uses

func (client *DockerClient) InspectContainer(id string) (*ContainerInfo, error)

func (*DockerClient) InspectImage Uses

func (client *DockerClient) InspectImage(id string) (*ImageInfo, error)

func (*DockerClient) InspectNetwork Uses

func (client *DockerClient) InspectNetwork(id string) (*NetworkResource, error)

func (*DockerClient) KillContainer Uses

func (client *DockerClient) KillContainer(id, signal string) error

func (*DockerClient) ListContainers Uses

func (client *DockerClient) ListContainers(all bool, size bool, filters string) ([]Container, error)

func (*DockerClient) ListImages Uses

func (client *DockerClient) ListImages(all bool) ([]*Image, error)

func (*DockerClient) ListNetworks Uses

func (client *DockerClient) ListNetworks(filters string) ([]*NetworkResource, error)

func (*DockerClient) ListVolumes Uses

func (client *DockerClient) ListVolumes() ([]*Volume, error)

func (*DockerClient) LoadImage Uses

func (client *DockerClient) LoadImage(reader io.Reader) error

func (*DockerClient) MonitorEvents Uses

func (client *DockerClient) MonitorEvents(options *MonitorEventsOptions, stopChan <-chan struct{}) (<-chan EventOrError, error)

func (*DockerClient) PauseContainer Uses

func (client *DockerClient) PauseContainer(id string) error

func (*DockerClient) PullImage Uses

func (client *DockerClient) PullImage(name string, auth *AuthConfig) error

func (*DockerClient) PushImage Uses

func (client *DockerClient) PushImage(name string, tag string, auth *AuthConfig) error

func (*DockerClient) RemoveContainer Uses

func (client *DockerClient) RemoveContainer(id string, force, volumes bool) error

func (*DockerClient) RemoveImage Uses

func (client *DockerClient) RemoveImage(name string, force bool) ([]*ImageDelete, error)

func (*DockerClient) RemoveNetwork Uses

func (client *DockerClient) RemoveNetwork(id string) error

func (*DockerClient) RemoveVolume Uses

func (client *DockerClient) RemoveVolume(name string) error

func (*DockerClient) RenameContainer Uses

func (client *DockerClient) RenameContainer(oldName string, newName string) error

func (*DockerClient) RestartContainer Uses

func (client *DockerClient) RestartContainer(id string, timeout int) error

func (*DockerClient) SearchImages Uses

func (client *DockerClient) SearchImages(query, registry string, auth *AuthConfig) ([]ImageSearch, error)

func (*DockerClient) StartContainer Uses

func (client *DockerClient) StartContainer(id string, config *HostConfig) error

func (*DockerClient) StartMonitorEvents Uses

func (client *DockerClient) StartMonitorEvents(cb Callback, ec chan error, args ...interface{})

func (*DockerClient) StartMonitorStats Uses

func (client *DockerClient) StartMonitorStats(id string, cb StatCallback, ec chan error, args ...interface{})

func (*DockerClient) StopAllMonitorEvents Uses

func (client *DockerClient) StopAllMonitorEvents()

func (*DockerClient) StopAllMonitorStats Uses

func (client *DockerClient) StopAllMonitorStats()

func (*DockerClient) StopContainer Uses

func (client *DockerClient) StopContainer(id string, timeout int) error

func (*DockerClient) TagImage Uses

func (client *DockerClient) TagImage(nameOrID string, repo string, tag string, force bool) error

func (*DockerClient) UnpauseContainer Uses

func (client *DockerClient) UnpauseContainer(id string) error

func (*DockerClient) Version Uses

func (client *DockerClient) Version() (*Version, error)

func (*DockerClient) Wait Uses

func (client *DockerClient) Wait(id string) <-chan WaitResult

type EndpointIPAMConfig Uses

type EndpointIPAMConfig struct {
    IPv4Address string `json:",omitempty"`
    IPv6Address string `json:",omitempty"`
}

EndpointIPAMConfig represents IPAM configurations for the endpoint

type EndpointResource Uses

type EndpointResource struct {
    Name        string
    EndpointID  string
    MacAddress  string
    IPv4Address string
    IPv6Address string
}

EndpointResource contains network resources allocated and used for a container in a network

type EndpointSettings Uses

type EndpointSettings struct {
    // Configurations
    IPAMConfig *EndpointIPAMConfig
    Links      []string
    Aliases    []string
    // Operational data
    NetworkID           string
    EndpointID          string
    Gateway             string
    IPAddress           string
    IPPrefixLen         int
    IPv6Gateway         string
    GlobalIPv6Address   string
    GlobalIPv6PrefixLen int
    MacAddress          string
}

EndpointSettings stores the network endpoint details

type Error Uses

type Error struct {
    StatusCode int
    Status     string
    // contains filtered or unexported fields
}

func (Error) Error Uses

func (e Error) Error() string

type Event Uses

type Event struct {
    Status string `json:"status,omitempty"`
    ID     string `json:"id,omitempty"`
    From   string `json:"from,omitempty"`

    Type   string
    Action string
    Actor  Actor

    Time     int64 `json:"time,omitempty"`
    TimeNano int64 `json:"timeNano,omitempty"`
}

type EventOrError Uses

type EventOrError struct {
    Event
    Error error
}

type ExecConfig Uses

type ExecConfig struct {
    AttachStdin  bool
    AttachStdout bool
    AttachStderr bool
    Tty          bool
    Cmd          []string
    Container    string
    Detach       bool
}

type HostConfig Uses

type HostConfig struct {
    Binds                []string
    ContainerIDFile      string
    LxcConf              []map[string]string
    Memory               int64
    MemoryReservation    int64
    MemorySwap           int64
    KernelMemory         int64
    CpuShares            int64
    CpuPeriod            int64
    CpusetCpus           string
    CpusetMems           string
    CpuQuota             int64
    BlkioWeight          int64
    OomKillDisable       bool
    MemorySwappiness     int64
    Privileged           bool
    PortBindings         map[string][]PortBinding
    Links                []string
    PublishAllPorts      bool
    Dns                  []string
    DNSOptions           []string
    DnsSearch            []string
    ExtraHosts           []string
    VolumesFrom          []string
    Devices              []DeviceMapping
    NetworkMode          string
    IpcMode              string
    PidMode              string
    UTSMode              string
    CapAdd               []string
    CapDrop              []string
    GroupAdd             []string
    RestartPolicy        RestartPolicy
    SecurityOpt          []string
    ReadonlyRootfs       bool
    Ulimits              []Ulimit
    LogConfig            LogConfig
    CgroupParent         string
    ConsoleSize          [2]int
    VolumeDriver         string
    OomScoreAdj          int
    Tmpfs                map[string]string
    ShmSize              int64 `json:"omitempty"`
    BlkioWeightDevice    []WeightDevice
    BlkioDeviceReadBps   []ThrottleDevice
    BlkioDeviceWriteBps  []ThrottleDevice
    BlkioDeviceReadIOps  []ThrottleDevice
    BlkioDeviceWriteIOps []ThrottleDevice
}

type IPAM Uses

type IPAM struct {
    Driver  string
    Options map[string]string //Per network IPAM driver options
    Config  []IPAMConfig
}

IPAM represents IP Address Management

type IPAMConfig Uses

type IPAMConfig struct {
    Subnet     string            `json:",omitempty"`
    IPRange    string            `json:",omitempty"`
    Gateway    string            `json:",omitempty"`
    AuxAddress map[string]string `json:"AuxiliaryAddresses,omitempty"`
}

IPAMConfig represents IPAM configurations

type Image Uses

type Image struct {
    Created     int64
    Id          string
    Labels      map[string]string
    ParentId    string
    RepoDigests []string
    RepoTags    []string
    Size        int64
    VirtualSize int64
}

type ImageDelete Uses

type ImageDelete struct {
    Deleted  string
    Untagged string
}

type ImageInfo Uses

type ImageInfo struct {
    Architecture    string
    Author          string
    Comment         string
    Config          *ContainerConfig
    Container       string
    ContainerConfig *ContainerConfig
    Created         time.Time
    DockerVersion   string
    Id              string
    Os              string
    Parent          string
    Size            int64
    VirtualSize     int64
}

type ImageSearch Uses

type ImageSearch struct {
    Description string `json:"description,omitempty" yaml:"description,omitempty"`
    IsOfficial  bool   `json:"is_official,omitempty" yaml:"is_official,omitempty"`
    IsAutomated bool   `json:"is_automated,omitempty" yaml:"is_automated,omitempty"`
    Name        string `json:"name,omitempty" yaml:"name,omitempty"`
    StarCount   int    `json:"star_count,omitempty" yaml:"star_count,omitempty"`
}

type Info Uses

type Info struct {
    ID                 string
    Containers         int64
    Driver             string
    DriverStatus       [][]string
    ExecutionDriver    string
    Images             int64
    KernelVersion      string
    OperatingSystem    string
    NCPU               int64
    MemTotal           int64
    Name               string
    Labels             []string
    Debug              interface{}
    NFd                int64
    NGoroutines        int64
    SystemTime         string
    NEventsListener    int64
    InitPath           string
    InitSha1           string
    IndexServerAddress string
    MemoryLimit        interface{}
    SwapLimit          interface{}
    IPv4Forwarding     interface{}
    BridgeNfIptables   bool
    BridgeNfIp6tables  bool
    DockerRootDir      string
    HttpProxy          string
    HttpsProxy         string
    NoProxy            string
}

Info is the struct returned by /info The API is currently in flux, so Debug, MemoryLimit, SwapLimit, and IPv4Forwarding are interfaces because in docker 1.6.1 they are 0 or 1 but in master they are bools.

type LogConfig Uses

type LogConfig struct {
    Type   string            `json:"type"`
    Config map[string]string `json:"config"`
}

type LogOptions Uses

type LogOptions struct {
    Follow     bool
    Stdout     bool
    Stderr     bool
    Timestamps bool
    Tail       int64
}

type MemoryStats Uses

type MemoryStats struct {
    Usage    uint64            `json:"usage"`
    MaxUsage uint64            `json:"max_usage"`
    Stats    map[string]uint64 `json:"stats"`
    Failcnt  uint64            `json:"failcnt"`
    Limit    uint64            `json:"limit"`
}

type MonitorEventsFilters Uses

type MonitorEventsFilters struct {
    Event      string   `json:",omitempty"`
    Events     []string `json:",omitempty"`
    Image      string   `json:",omitempty"`
    Images     []string `json:",omitempty"`
    Container  string   `json:",omitempty"`
    Containers []string `json:",omitempty"`
}

type MonitorEventsOptions Uses

type MonitorEventsOptions struct {
    Since   int
    Until   int
    Filters *MonitorEventsFilters `json:",omitempty"`
}

type NetworkConnect Uses

type NetworkConnect struct {
    Container string
}

NetworkConnect represents the data to be used to connect a container to the network

type NetworkCreate Uses

type NetworkCreate struct {
    Name           string
    CheckDuplicate bool
    Driver         string
    IPAM           IPAM
    Internal       bool
    Options        map[string]string
    Labels         map[string]string // Labels hold metadata about the network
}

NetworkCreate is the expected body of the "create network" http request message

type NetworkCreateResponse Uses

type NetworkCreateResponse struct {
    ID      string `json:"Id"`
    Warning string
}

NetworkCreateResponse is the response message sent by the server for network create call

type NetworkDisconnect Uses

type NetworkDisconnect struct {
    Container string
    Force     bool
}

NetworkDisconnect represents the data to be used to disconnect a container from the network

type NetworkResource Uses

type NetworkResource struct {
    Name   string
    ID     string `json:"Id"`
    Scope  string
    Driver string
    IPAM   IPAM
    //Internal   bool
    Containers map[string]EndpointResource
    Options    map[string]string
    Labels     map[string]string // Labels hold metadata about the network
}

NetworkResource is the body of the "get network" http response message

type NetworkStats Uses

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 NetworkingConfig Uses

type NetworkingConfig struct {
    EndpointsConfig map[string]*EndpointSettings // Endpoint configs for each conencting network
}

NetworkingConfig represents the container's networking configuration for each of its interfaces Carries the networink configs specified in the `docker run` and `docker network connect` commands

type Port Uses

type Port struct {
    IP          string
    PrivatePort int
    PublicPort  int
    Type        string
}

type PortBinding Uses

type PortBinding struct {
    HostIp   string
    HostPort string
}

type RespContainersCreate Uses

type RespContainersCreate struct {
    Id       string
    Warnings []string
}

type RestartPolicy Uses

type RestartPolicy struct {
    Name              string
    MaximumRetryCount int64
}

type StatCallback Uses

type StatCallback func(string, *Stats, chan error, ...interface{})

type State Uses

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 Uses

func (s *State) StateString() string

StateString returns a single string to describe state Stoken from docker/docker/daemon/state.go

func (*State) String Uses

func (s *State) String() string

String returns a human-readable description of the state Stoken from docker/docker/daemon/state.go

type Stats Uses

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 StatsOrError Uses

type StatsOrError struct {
    Stats
    Error error
}

type ThrottleDevice Uses

type ThrottleDevice struct {
    Path string
    Rate uint64
}

type ThrottlingData Uses

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

type Ulimit Uses

type Ulimit struct {
    Name string `json:"name"`
    Soft uint64 `json:"soft"`
    Hard uint64 `json:"hard"`
}

type Version Uses

type Version struct {
    ApiVersion    string
    Arch          string
    GitCommit     string
    GoVersion     string
    KernelVersion string
    Os            string
    Version       string
}

type Volume Uses

type Volume struct {
    Name       string            // Name is the name of the volume
    Driver     string            // Driver is the Driver name used to create the volume
    Mountpoint string            // Mountpoint is the location on disk of the volume
    Labels     map[string]string // Labels hold metadata about the volume
}

type VolumeCreateRequest Uses

type VolumeCreateRequest struct {
    Name       string            // Name is the requested name of the volume
    Driver     string            // Driver is the name of the driver that should be used to create the volume
    DriverOpts map[string]string // DriverOpts holds the driver specific options to use for when creating the volume.
    Labels     map[string]string // Labels hold metadata about the volume
}

type VolumesListResponse Uses

type VolumesListResponse struct {
    Volumes []*Volume // Volumes is the list of volumes being returned
}

type WaitResult Uses

type WaitResult struct {
    ExitCode int
    Error    error
}

type WeightDevice Uses

type WeightDevice struct {
    Path   string
    Weight uint16
}

Directories

PathSynopsis
examples
examples/stats
mockclient
nopclient

Package dockerclient imports 18 packages (graph) and is imported by 1014 packages. Updated 2016-07-22. Refresh now. Tools for package owners.