containers

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrContainerNotFound = errors.New("container not found")
)

Functions

This section is empty.

Types

type Client

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

Client is generic container client.

func NewClient

func NewClient(log *logging.Logger, cgroupClient *cgroup.Client, containerdSock string, procHandler *proc.Proc) (*Client, error)

func (*Client) AddContainerByCgroupID added in v1.15.0

func (c *Client) AddContainerByCgroupID(ctx context.Context, cgroupID cgroup.ID) (cont *Container, rerrr error)

func (*Client) CleanupCgroup

func (c *Client) CleanupCgroup(cgroup cgroup.ID)

func (*Client) GetCgroupCpuStats added in v1.7.0

func (c *Client) GetCgroupCpuStats(cont *Container) (*cgroup.CPUStat, error)

func (*Client) GetCgroupMemoryStats added in v1.7.0

func (c *Client) GetCgroupMemoryStats(cont *Container) (*cgroup.MemoryStat, error)

func (*Client) GetCgroupsInNamespace

func (c *Client) GetCgroupsInNamespace(namespace string) []uint64

func (*Client) GetContainerForCgroup

func (c *Client) GetContainerForCgroup(ctx context.Context, cgroup uint64) (*Container, error)

func (*Client) ListContainers

func (c *Client) ListContainers() []*Container

func (*Client) LoadContainerTasks added in v1.15.0

func (c *Client) LoadContainerTasks(ctx context.Context) ([]ContainerProcess, error)

func (*Client) LookupContainerForCgroupInCache added in v1.1.0

func (c *Client) LookupContainerForCgroupInCache(cgroup uint64) (*Container, bool, error)

func (*Client) RegisterContainerCreatedListener

func (c *Client) RegisterContainerCreatedListener(l ContainerCreatedListener)

func (*Client) RegisterContainerDeletedListener

func (c *Client) RegisterContainerDeletedListener(l ContainerDeletedListener)

type Container

type Container struct {
	ID           string
	Name         string
	CgroupID     uint64
	PodNamespace string
	PodUID       string
	PodName      string
	Cgroup       *cgroup.Cgroup
	PIDs         []uint32
	Err          error
}

type ContainerCreatedListener

type ContainerCreatedListener func(c *Container)

type ContainerDeletedListener

type ContainerDeletedListener func(c *Container)

type ContainerProcess added in v1.15.0

type ContainerProcess struct {
	ContainerID string
	PID         uint32
}

Jump to

Keyboard shortcuts

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