runtime

package
v0.0.0-...-fb108f3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrImageNotFound means the requested docker image is not found locally
	ErrImageNotFound = 101
	// ErrNetworkNotFound means the requested docker network is not found locally
	ErrNetworkNotFound = 102
	// ErrContainerNotFound means the requested docker container is not found locally
	ErrContainerNotFound = 103
)

Variables

View Source
var ErrSandboxNotFound = errors.New("sandbox not found")

Functions

This section is empty.

Types

type CPUInfo

type CPUInfo struct {
	Model     string  `json:"model"`
	Cores     int     `json:"cores"`
	Frequency float64 `json:"frequency"`
	Cache     int32   `json:"cache"`
}

CPUInfo holds information about the characteristics of the CPU

type CPUStats

type CPUStats struct {
	Usage int     `json:"usage"`
	Info  CPUInfo `json:"info"`
}

CPUStats holds information about the characteristics of the CPU and it's usage

type HardwareStats

type HardwareStats struct {
	Memory  MemoryInfo   `json:"memory"`
	CPU     CPUStats     `json:"cpu"`
	Storage StorageStats `json:"storage"`
}

HardwareStats holds information about the state and usage of the system

type MemoryInfo

type MemoryInfo struct {
	Total     int `json:"total"`
	Usage     int `json:"usage"`
	Cached    int `json:"cached"`
	Available int `json:"available"`
}

MemoryInfo holds information bout memory usage

type PlatformImage

type PlatformImage interface {
	GetID() string
	GetDataPath() string
	GetRepoTags() []string
	GetLabels() map[string]string
}

type RuntimePlatform

type RuntimePlatform interface {
	Init() error
	GetSandbox(id string) (RuntimeSandbox, error)
	GetAllSandboxes() (map[string]RuntimeSandbox, error)
	GetImage(id string) (PlatformImage, error)
	ImageExistsLocally(id string) (bool, error)
	GetAllImages() (map[string]PlatformImage, error)
	PullImage(imageRef string) error
	RemoveImage(id string) error
	NewSandbox(name string, appID string, imageID string, persistence bool) (RuntimeSandbox, error)
	GetHWStats() (HardwareStats, error)
}

RuntimePlatform represents the platform that manages the RuntimeSandboxs. For now Docker.

func Create

func Create(networkManager *network.Manager, runtimeUnixSocket string) RuntimePlatform

Create initializes the run time platform

type RuntimeSandbox

type RuntimeSandbox interface {
	Start(ip net.IP) error
	Stop() error
	Update() error
	Remove() error
	GetID() string
	GetStatus() string
	GetLogs() ([]byte, error)
	GetExitCode() int
}

RuntimeSandbox represents the abstract concept of a running program: it can be a container, VM or process.

type StorageStats

type StorageStats struct {
	Total     int    `json:"total"`
	Path      string `json:"path"`
	Usage     int    `json:"usage"`
	Available int    `json:"available"`
}

StorageStats holds information about disk usage

Jump to

Keyboard shortcuts

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