docker

package
v0.0.0-...-a8f3bf5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2018 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNetworkIDNotFound   = errors.New("Network ID not found")
	ErrServiceIDNotFound   = errors.New("Service ID not found")
	ErrServiceNameNotFound = errors.New("Service Name not found")
	ErrNodeIDNotFound      = errors.New("Node ID not found")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*docker.Client
}

func NewSSHClient

func NewSSHClient(host string, unixSocket string, apiVersion string, sshConfig *ssh.ClientConfig) (*Client, error)

NewSSHClient returns a docker client connected to server using ssh connection

func (*Client) ExecCommand

func (client *Client) ExecCommand(ctx context.Context, cid string, cmd []string) ([]byte, error)

func (*Client) FindNetworkByID

func (client *Client) FindNetworkByID(id string, networks []types.NetworkResource) (*types.NetworkResource, error)

FindNetworkByID searchs and returns the NetworkResource corresponding to the given ID

func (*Client) FindSwarmNodeByID

func (client *Client) FindSwarmNodeByID(id string, nodes []swarm.Node) (*swarm.Node, error)

FindNodeByServiceID returns the node corresponding to the given ID

func (*Client) FindSwarmServiceByID

func (client *Client) FindSwarmServiceByID(id string, services []swarm.Service) (*swarm.Service, error)

FindServiceByID searchs and returns the swarm service corresponding to the given ID

func (*Client) FindSwarmServiceByName

func (client *Client) FindSwarmServiceByName(name string, services []swarm.Service) (*swarm.Service, error)

FindServiceByName searchs and returns the swarm service corresponding to the given name

func (*Client) FindSwarmTasksByServiceID

func (client *Client) FindSwarmTasksByServiceID(serviceId string, tasks []swarm.Task) []swarm.Task

FindSwarmTasksByServiceID searchs and returns the tasks related to the given service ID

func (*Client) GetContainers

func (client *Client) GetContainers(ctx context.Context, options map[string]string) ([]types.Container, error)

GetContainers return a list of containers running on the current host of the cluster (like docker ps)

For ContainerListOptions, only Filter is supported. Some other options are missing

func (*Client) GetNetworks

func (client *Client) GetNetworks(ctx context.Context, options map[string]string) ([]types.NetworkResource, error)

GetNetworks return a list of network defined in the cluster

func (*Client) GetSwarmNodes

func (client *Client) GetSwarmNodes(ctx context.Context, options map[string]string) ([]swarm.Node, error)

GetSwarmNodes return a list of swarm nodes in the cluster

func (*Client) GetSwarmServices

func (client *Client) GetSwarmServices(ctx context.Context, options map[string]string) ([]swarm.Service, error)

GetSwarmServices returns a list of swarm services created in the cluster

func (*Client) GetSwarmTasks

func (client *Client) GetSwarmTasks(ctx context.Context, options map[string]string) ([]swarm.Task, error)

GetSwarmTasks return a list of swarm containers in the cluster

func (*Client) UpdateSwarmService

func (client *Client) UpdateSwarmService(ctx context.Context, id string, version swarm.Version, spec swarm.ServiceSpec, opts map[string]interface{}) (types.ServiceUpdateResponse, error)

UpdateSwarmService updates a service with the given params

spec and opts arguments are map[string]interface{} that will be mapped respectively to swarm.ServiceSpec and types.ServiceUpdateOptions structures

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL