converge: github.com/asteris-llc/converge/resource/docker Index | Files | Directories

package docker

import "github.com/asteris-llc/converge/resource/docker"

Index

Package Files

docker.go port.go

type APIClient Uses

type APIClient interface {
    FindImage(string) (*dc.Image, error)
    PullImage(string, string) error
    FindContainer(string) (*dc.Container, error)
    CreateContainer(dc.CreateContainerOptions) (*dc.Container, error)
    StartContainer(string, string) error
    ConnectNetwork(string, *dc.Container) error
}

APIClient provides access to docker

type Client Uses

type Client struct {
    *dc.Client
    PullInactivityTimeout time.Duration
}

Client provides api access to Docker

func NewDockerClient Uses

func NewDockerClient() (*Client, error)

NewDockerClient returns a docker client with the default configuration

func (*Client) ConnectNetwork Uses

func (c *Client) ConnectNetwork(name string, container *dc.Container) error

ConnectNetwork connects the container to a network

func (*Client) CreateContainer Uses

func (c *Client) CreateContainer(opts dc.CreateContainerOptions) (*dc.Container, error)

CreateContainer creates a container with the specified options

func (*Client) CreateNetwork Uses

func (c *Client) CreateNetwork(opts dc.CreateNetworkOptions) (*dc.Network, error)

CreateNetwork creates a docker network

func (*Client) CreateVolume Uses

func (c *Client) CreateVolume(opts dc.CreateVolumeOptions) (*dc.Volume, error)

CreateVolume creates a docker volume

func (*Client) FindContainer Uses

func (c *Client) FindContainer(name string) (*dc.Container, error)

FindContainer returns a container matching the specified name

func (*Client) FindImage Uses

func (c *Client) FindImage(repoTag string) (*dc.Image, error)

FindImage finds a local docker image with the specified repo tag

func (*Client) FindNetwork Uses

func (c *Client) FindNetwork(name string) (*dc.Network, error)

FindNetwork finds the network with the specified name

func (*Client) FindVolume Uses

func (c *Client) FindVolume(name string) (*dc.Volume, error)

FindVolume finds the volume with the specified name

func (*Client) ListNetworks Uses

func (c *Client) ListNetworks() ([]dc.Network, error)

ListNetworks returns the docker networks

func (*Client) PullImage Uses

func (c *Client) PullImage(name, tag string) error

PullImage pulls an image with the specified name and tag

func (*Client) RemoveNetwork Uses

func (c *Client) RemoveNetwork(name string) error

RemoveNetwork removes a docker volume

func (*Client) RemoveVolume Uses

func (c *Client) RemoveVolume(name string) error

RemoveVolume removes a docker volume

func (*Client) StartContainer Uses

func (c *Client) StartContainer(name, containerID string) error

StartContainer starts the container with the specified ID

type NetworkClient Uses

type NetworkClient interface {
    ListNetworks() ([]dc.Network, error)
    FindNetwork(string) (*dc.Network, error)
    CreateNetwork(dc.CreateNetworkOptions) (*dc.Network, error)
    RemoveNetwork(string) error
}

NetworkClient manage Docker networks

type Port Uses

type Port struct {
    dc.Port
}

Port represents a docker port specification

func NewPort Uses

func NewPort(s string) Port

NewPort creates a new Port

func (Port) PortNum Uses

func (p Port) PortNum() string

PortNum returns the port as a string

func (Port) String Uses

func (p Port) String() string

String returns the port as a string with Port and Protocol

func (Port) ToDockerClientPort Uses

func (p Port) ToDockerClientPort() dc.Port

ToDockerClientPort returns a dc.Port from a Port

type VolumeClient Uses

type VolumeClient interface {
    FindVolume(string) (*dc.Volume, error)
    CreateVolume(dc.CreateVolumeOptions) (*dc.Volume, error)
    RemoveVolume(string) error
}

VolumeClient manages Docker volumes

Directories

PathSynopsis
container
image
network
volume

Package docker imports 6 packages (graph) and is imported by 4 packages. Updated 2017-01-13. Refresh now. Tools for package owners.