api

package
v0.0.0-...-fa282b4 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DoneCh is used to send a DONE signal
	DoneCh = make(chan struct{})

	// StatsCh holds the container stats
	StatsCh = make(chan StatsData)

	// DoneSignalSent some signal
	DoneSignalSent = true
)

Functions

func GetContainers

func GetContainers(ctx context.Context, host string, quite bool, all bool) (*[]types.Container, error)

GetContainers returns containers running on a host

func GetContainersCount

func GetContainersCount(host string, all bool) (int, error)

GetContainersCount returns the number of containers running on a host

func GetDockerStats

func GetDockerStats(ctx context.Context, host string, id string, cIndex int32)

GetDockerStats returns CPU usage of a container

func RemoveContainer

func RemoveContainer(ctx context.Context, host string, id string) error

RemoveContainer removes a container in exited or created state

func StartContainer

func StartContainer(ctx context.Context, host string, id string) error

StartContainer starts a stopped or created container

func StopContainer

func StopContainer(ctx context.Context, host string, id string) error

StopContainer stops a container in running state

Types

type StatsData

type StatsData struct {
	Index int32   `json:"index"`
	Usage float32 `json:"usage"`
}

StatsData represents the stats of a container

Jump to

Keyboard shortcuts

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