client

package
v0.0.0-...-502bd87 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client Client

func Obtain

func Obtain() *Client

Obtain Obtain

func (*Client) Container

func (c *Client) Container() *Container

Container Container

func (*Client) Docker

func (c *Client) Docker() *Docker

Docker Docker

func (*Client) Image

func (c *Client) Image() *Image

Image Image

func (*Client) Network

func (c *Client) Network() *Network

Network Network

func (*Client) Node

func (c *Client) Node() *Node

Node Node

func (*Client) Proc

func (c *Client) Proc() *Proc

Proc Proc

func (*Client) Project

func (c *Client) Project() *Project

Project 获取swarm堆栈服务对象

func (*Client) Resource

func (c *Client) Resource() *Resource

Resource Resource

func (*Client) Service

func (c *Client) Service() *Service

Service Service

func (*Client) Stack

func (c *Client) Stack() *Stack

Stack 获取swarm堆栈服务对象

func (*Client) Swarm

func (c *Client) Swarm() *Swarm

Swarm Swarm

func (*Client) Volume

func (c *Client) Volume() *Volume

Volume Volume

type Container

type Container struct {
}

Container Container

func (*Container) Inspect

func (c *Container) Inspect(ctx context.Context, containerID string) (types.ContainerJSON, []byte, error)

Inspect 获取容器信息

func (*Container) List

func (c *Container) List(ctx context.Context) ([]types.Container, error)

List 获取服务信息

func (*Container) Logs

func (c *Container) Logs(ctx context.Context, containerID string, since, until time.Time) ([]byte, error)

Logs 获取容器日志

func (*Container) Stats

func (c *Container) Stats(ctx context.Context, containerID string) (*types.Stats, string, error)

Stats Stats

func (*Container) StatsAll

func (c *Container) StatsAll(ctx context.Context) ([]*types.Stats, error)

StatsAll StatsAll

type Docker

type Docker struct {
}

func (*Docker) Info

func (d *Docker) Info(ctx context.Context) (info types.Info, err error)

Info 获取资源信息

type Image

type Image struct {
}

Image Image

func (*Image) List

func (i *Image) List(ctx context.Context) ([]types.ImageSummary, error)

List List

func (*Image) Pull

func (i *Image) Pull(ctx context.Context, refStr string) error

Pull Pull

func (*Image) Remove

func (i *Image) Remove(ctx context.Context, id string) ([]types.ImageDeleteResponseItem, error)

Remove Remove

func (*Image) Tag

func (i *Image) Tag(ctx context.Context, source, target string) error

Tag Tag

type Network

type Network struct {
}

Network Network

func (*Network) Connect

func (s *Network) Connect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error

Connect Connect a container to a network

func (*Network) Create

Create Create a network

func (*Network) Disconnect

func (s *Network) Disconnect(ctx context.Context, networkID, containerID string, force bool) error

Disconnect Disconnect a container from a network

func (*Network) Inspect

func (s *Network) Inspect(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error)

Inspect Display detailed information on one or more networks

func (*Network) List

List List networks

func (*Network) Prune

func (s *Network) Prune(ctx context.Context, pruneFilters filters.Args) (types.NetworksPruneReport, error)

Prune Remove all unused networks

func (*Network) Remove

func (s *Network) Remove(ctx context.Context, networkID string) error

Remove Remove one or more networks

type Node

type Node struct {
}

func (*Node) Inspect

func (n *Node) Inspect(ctx context.Context, nodeID string) (swarm.Node, []byte, error)

Inspect 获取节点信息

func (*Node) List

func (n *Node) List(ctx context.Context) ([]swarm.Node, error)

List 获取节点信息

type Proc

type Proc struct {
	// contains filtered or unexported fields
}

Proc Proc

func (*Proc) Listen

func (p *Proc) Listen(pNew *proc.Proc)

Listen Listen

func (*Proc) Resources

func (p *Proc) Resources() map[string]*proc.Proc

Resources Resources

type Project

type Project struct {
}

Project Project

func (*Project) Deploy

func (p *Project) Deploy(ctx context.Context, project *proto.ReqProject) (err error)

Deploy 部署新的项目

func (*Project) Remove

func (p *Project) Remove(ctx context.Context, remove *proto.ReqProjectRemove) (err error)

Remove 部署新的项目

func (*Project) ServiceCompare

func (p *Project) ServiceCompare(ctx context.Context, compare *proto.ServiceCompare) (*proto.ServiceCompare, error)

ServiceCompare 部署新的项目

func (*Project) ServiceStats

func (p *Project) ServiceStats(ctx context.Context, serviceName string, isSwarm bool) (map[string]*proto.ServiceStats, error)

ServiceStats 查询Service所有容器的Stats

func (*Project) Update

func (p *Project) Update(ctx context.Context, update *proto.ReqProjectUpdate) (err error)

Update 部署新的项目

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

func (*Resource) Info

func (r *Resource) Info(ctx context.Context) (resource *proto.ResourceInfo, err error)

Info 获取资源信息

func (*Resource) Proc

func (r *Resource) Proc(pNew *proc.Proc)

func (*Resource) StatsAll4Containers

func (r *Resource) StatsAll4Containers(ctx context.Context) (*proto.ReqContainerSync, error)

StatsAll StatsAll

func (*Resource) SyncContainers

func (r *Resource) SyncContainers(ctx context.Context, sync *proto.ReqContainerSync) (resource *proto.Response, err error)

type Service

type Service struct {
}

func (*Service) Create

List 获取服务信息

func (*Service) Inspect

func (s *Service) Inspect(ctx context.Context, serviceID string) (swarm.Service, []byte, error)

Inspect 获取服务信息

func (*Service) List

func (s *Service) List(ctx context.Context) ([]swarm.Service, error)

List 获取服务信息

func (*Service) Logs

func (s *Service) Logs(ctx context.Context, serviceID string, since, until time.Time) ([]byte, error)

Logs 获取服务日志

func (*Service) Process

func (s *Service) Process(ctx context.Context, filters filters.Args) ([]swarm.Task, error)

Process List the tasks of one or more services

func (*Service) Remove

func (s *Service) Remove(ctx context.Context, serviceID string) error

Remove Remove one or more services

func (*Service) Resources

func (s *Service) Resources(ctx context.Context, serviceID string) (*proto.Resources, error)

Resources 所有服务资源情况

func (*Service) ResourcesAll

func (s *Service) ResourcesAll(ctx context.Context) (*proto.Resources, error)

ResourcesAll 所有服务资源情况

func (*Service) Update

func (s *Service) Update(ctx context.Context, serviceID string, service swarm.ServiceSpec) (types.ServiceUpdateResponse, error)

Update Update a service

type Stack

type Stack struct {
}

func (*Stack) Deploy

func (s *Stack) Deploy(compose *model.Compose, stackName string) error

Deploy 部署新的堆栈或更新现有堆栈

tail 代表是否实时输出命令执行的日志信息

func (*Stack) List

func (s *Stack) List() (stacks []*proto.Stack, err error)

List 列出现有堆栈

func (*Stack) Process

func (s *Stack) Process(stackName string) (stackProcesses []*proto.StackProcess, err error)

Process 列出堆栈中的任务

func (*Stack) Remove

func (s *Stack) Remove(stackName ...string) error

Remove 删除一个或多个堆栈

func (*Stack) Services

func (s *Stack) Services(stackName string) (services []*proto.StackService, err error)

Services 列出堆栈中的服务

type Swarm

type Swarm struct {
}

func (*Swarm) Inspect

func (s *Swarm) Inspect() (swarm.Swarm, error)

Inspect inspects the swarm.

type Volume

type Volume struct {
}

Volume Volume

func (*Volume) Create

func (v *Volume) Create(ctx context.Context, options volume.VolumeCreateBody) (types.Volume, error)

Create Create a network

func (*Volume) Inspect

func (v *Volume) Inspect(ctx context.Context, volumeID string) (types.Volume, []byte, error)

Inspect Display detailed information on one or more networks

func (*Volume) List

List List networks

func (*Volume) Prune

func (v *Volume) Prune(ctx context.Context, pruneFilters filters.Args) (types.VolumesPruneReport, error)

Prune Remove all unused networks

func (*Volume) Remove

func (v *Volume) Remove(ctx context.Context, volumeID string, force bool) error

Remove Remove one or more networks

Jump to

Keyboard shortcuts

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