api

package
v0.0.0-...-d691e2b Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package api

Package api

Index

Constants

View Source
const RuntimeTypeRunc = "runc"

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	ID          string            `json:"id"`
	Pid         int               `json:"pid"`
	Status      string            `json:"status"`
	Bundle      string            `json:"bundle"`
	Rootfs      string            `json:"rootfs"`
	Created     time.Time         `json:"created"`
	Annotations map[string]string `json:"annotations"`
}

type ContainerManager

type ContainerManager interface {
	Name() string
	StartContainer(*CreateContainerRequest) error
	RemoveContainer(ID string, force bool) error
	KillContainer(ID string, signal string, all bool) error
	PauseContainer(ID string) error
	ResumeContainer(ID string) error
	ListContainers() (list []*Container, err error)
	ContainerInfo(ID string) (container *Container, err error)
	UpdateContainer(ID string, request *UpdateContainerRequest) error
}

type ContainerStdio

type ContainerStdio struct {
	Stdout io.WriteCloser
	Stderr io.WriteCloser
}

type CreateContainerRequest

type CreateContainerRequest struct {
	ID        string
	Bundle    string
	PidFile   string
	Detach    bool
	WithStdio bool
	Stdio     *ContainerStdio
}

type ResourceConfig

type ResourceConfig struct {
	// Memory limit (in bytes).
	Memory *int64

	MemorySwap *int64
	// CPU shares (relative weight vs. other containers).
	CpuShares *uint64
	// CPU hardcap limit (in usecs). Allowed cpu time in a given period.
	CpuQuota *int64
	// CPU quota period.
	CpuPeriod *uint64
	// HugePageLimit map from page size (in bytes) to limit (in bytes)
	HugePageLimit map[int64]int64
	// FreezeState
	Freezer *api.FreezerState
}

ResourceConfig holds information about all the supported cgroup resource parameters. port from k8s.io/kubernetes/pkg/kubelet/cm

type ResourceParams

type ResourceParams struct {
	MemLimits   string
	CPURequests float64
	CPULimits   float64
}

type UpdateContainerRequest

type UpdateContainerRequest struct {
	Memory   int64
	CPUQuota int64
}

Jump to

Keyboard shortcuts

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