Documentation ¶
Overview ¶
Helper functions copied from https://github.com/docker/cli/blob/master/cli/command/container/stats_helpers.go
Index ¶
- Constants
- Variables
- type Client
- type Docker
- type SocketClient
- func (c *SocketClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
- func (c *SocketClient) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
- func (c *SocketClient) ContainerStats(ctx context.Context, containerID string, stream bool) (types.ContainerStats, error)
- func (c *SocketClient) Info(ctx context.Context) (types.Info, error)
- func (c *SocketClient) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error)
- func (c *SocketClient) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
- func (c *SocketClient) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)
Constants ¶
View Source
const ( KB = 1000 MB = 1000 * KB GB = 1000 * MB TB = 1000 * GB PB = 1000 * TB )
KB, MB, GB, TB, PB...human friendly
Variables ¶
View Source
var NodeList = []swarm.Node{ swarm.Node{ ID: "0cl4jturcyd1ks3fwpd010kor", Status: swarm.NodeStatus{ State: "ready", }, }, swarm.Node{ ID: "0cl4jturcyd1ks3fwpd010kor", Status: swarm.NodeStatus{ State: "ready", }, }, }
View Source
var ServiceList = []swarm.Service{ swarm.Service{ ID: "qolkls9g5iasdiuihcyz9rnx2", Spec: swarm.ServiceSpec{ Annotations: swarm.Annotations{ Name: "test1", }, Mode: swarm.ServiceMode{ Replicated: &swarm.ReplicatedService{ Replicas: &two, }, }, }, }, swarm.Service{ ID: "qolkls9g5iasdiuihcyz9rn3", Spec: swarm.ServiceSpec{ Annotations: swarm.Annotations{ Name: "test2", }, Mode: swarm.ServiceMode{ Global: &swarm.GlobalService{}, }, }, }, }
View Source
var TaskList = []swarm.Task{ swarm.Task{ ID: "kwh0lv7hwwbh", ServiceID: "qolkls9g5iasdiuihcyz9rnx2", NodeID: "0cl4jturcyd1ks3fwpd010kor", Status: swarm.TaskStatus{ State: "running", }, DesiredState: "running", }, swarm.Task{ ID: "u78m5ojbivc3", ServiceID: "qolkls9g5iasdiuihcyz9rnx2", NodeID: "0cl4jturcyd1ks3fwpd010kor", Status: swarm.TaskStatus{ State: "running", }, DesiredState: "running", }, swarm.Task{ ID: "1n1uilkhr98l", ServiceID: "qolkls9g5iasdiuihcyz9rn3", NodeID: "0cl4jturcyd1ks3fwpd010kor", Status: swarm.TaskStatus{ State: "running", }, DesiredState: "running", }, }
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Info(ctx context.Context) (types.Info, error) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) ContainerStats(ctx context.Context, containerID string, stream bool) (types.ContainerStats, error) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) }
func NewEnvClient ¶
type Docker ¶
type Docker struct { Endpoint string ContainerNames []string GatherServices bool `toml:"gather_services"` Timeout internal.Duration PerDevice bool `toml:"perdevice"` Total bool `toml:"total"` TagEnvironment []string `toml:"tag_env"` LabelInclude []string `toml:"docker_label_include"` LabelExclude []string `toml:"docker_label_exclude"` ContainerInclude []string `toml:"container_name_include"` ContainerExclude []string `toml:"container_name_exclude"` SSLCA string `toml:"ssl_ca"` SSLCert string `toml:"ssl_cert"` SSLKey string `toml:"ssl_key"` InsecureSkipVerify bool // contains filtered or unexported fields }
Docker object
func (*Docker) Description ¶
func (*Docker) SampleConfig ¶
type SocketClient ¶
type SocketClient struct {
// contains filtered or unexported fields
}
func (*SocketClient) ContainerInspect ¶
func (c *SocketClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
func (*SocketClient) ContainerList ¶
func (c *SocketClient) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
func (*SocketClient) ContainerStats ¶
func (c *SocketClient) ContainerStats(ctx context.Context, containerID string, stream bool) (types.ContainerStats, error)
func (*SocketClient) NodeList ¶
func (c *SocketClient) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error)
func (*SocketClient) ServiceList ¶
func (c *SocketClient) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
func (*SocketClient) TaskList ¶
func (c *SocketClient) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)
Click to show internal directories.
Click to hide internal directories.