docker

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 10 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
}

func NewMultiClient

func NewMultiClient(hosts ...Host) (*Client, error)

func (*Client) StreamLogs added in v0.2.0

func (d *Client) StreamLogs(ctx context.Context, c *Container) (<-chan LogEntry, error)

StreamLogs streams logs from a specific container

func (*Client) WatchContainerStats

func (d *Client) WatchContainerStats(ctx context.Context) (<-chan ContainerStat, error)

func (*Client) WatchContainers

func (d *Client) WatchContainers(ctx context.Context) (<-chan []*Container, error)

type Container

type Container struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Image       string            `json:"image"`
	Command     string            `json:"command"`
	CreatedAt   time.Time         `json:"created"`
	StartedAt   time.Time         `json:"startedAt"`
	FinishedAt  time.Time         `json:"finishedAt"`
	State       string            `json:"state"`
	Health      string            `json:"health,omitempty"`
	MemoryLimit uint64            `json:"memoryLimit"`
	CPULimit    float64           `json:"cpuLimit"`
	Labels      map[string]string `json:"labels,omitempty"`
	Dozzle      string            `json:"dozzle,omitempty"`
	Host        string            `json:"host,omitempty"`
}

type ContainerEvent

type ContainerEvent struct {
	Name            string            `json:"name"`
	Host            string            `json:"host"`
	ActorID         string            `json:"actorId"`
	ActorAttributes map[string]string `json:"actorAttributes,omitempty"`
	Time            time.Time         `json:"time"`
}

type ContainerStat

type ContainerStat struct {
	ID                      string    `json:"id"`
	Time                    time.Time `json:"time"`
	CPUPercent              float64   `json:"cpu"`
	MemoryPercent           float64   `json:"memory"`
	MemoryUsage             float64   `json:"memoryUsage"`
	TotalNetworkReceived    uint64    `json:"networkReceive"`
	TotalNetworkTransmitted uint64    `json:"networkTransmitted"`
}

type Host

type Host struct {
	*client.Client
	config.HostConfig
	Local bool
}

type LogEntry added in v0.2.0

type LogEntry struct {
	ContainerID string    `json:"containerId"`
	Message     string    `json:"message"`
	Timestamp   time.Time `json:"timestamp"`
	Stream      string    `json:"stream"` // "stdout" or "stderr"
}

Jump to

Keyboard shortcuts

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