Documentation
¶
Index ¶
- Variables
- type Client
- func (client *Client) ExecCommand(ctx context.Context, cid string, cmd []string) ([]byte, error)
- func (client *Client) FindNetworkByID(id string, networks []types.NetworkResource) (*types.NetworkResource, error)
- func (client *Client) FindSwarmNodeByID(id string, nodes []swarm.Node) (*swarm.Node, error)
- func (client *Client) FindSwarmServiceByID(id string, services []swarm.Service) (*swarm.Service, error)
- func (client *Client) FindSwarmServiceByName(name string, services []swarm.Service) (*swarm.Service, error)
- func (client *Client) FindSwarmTasksByServiceID(serviceId string, tasks []swarm.Task) []swarm.Task
- func (client *Client) GetContainers(ctx context.Context, options map[string]string) ([]types.Container, error)
- func (client *Client) GetNetworks(ctx context.Context, options map[string]string) ([]types.NetworkResource, error)
- func (client *Client) GetSwarmNodes(ctx context.Context, options map[string]string) ([]swarm.Node, error)
- func (client *Client) GetSwarmServices(ctx context.Context, options map[string]string) ([]swarm.Service, error)
- func (client *Client) GetSwarmTasks(ctx context.Context, options map[string]string) ([]swarm.Task, error)
- func (client *Client) UpdateSwarmService(ctx context.Context, id string, version swarm.Version, spec swarm.ServiceSpec, ...) (types.ServiceUpdateResponse, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type 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) 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 ¶
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 ¶
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