Documentation
¶
Index ¶
- Constants
- Variables
- func NewClient(_ context.Context, socketPath string) (*containerdclient.Client, error)
- func ResolveConfSource(dataDir string) (string, error)
- type CPUMetrics
- type CommitSnapshotRequest
- type ContainerInfo
- type ContainerMetrics
- type ContainerSpec
- type CreateContainerRequest
- type DefaultService
- func (s *DefaultService) CheckNetwork(ctx context.Context, req NetworkRequest) error
- func (s *DefaultService) CommitSnapshot(ctx context.Context, req CommitSnapshotRequest) error
- func (s *DefaultService) CreateContainer(ctx context.Context, req CreateContainerRequest) (ContainerInfo, error)
- func (s *DefaultService) DeleteContainer(ctx context.Context, id string, opts *DeleteContainerOptions) error
- func (s *DefaultService) DeleteImage(ctx context.Context, ref string, opts *DeleteImageOptions) error
- func (s *DefaultService) DeleteTask(ctx context.Context, containerID string, opts *DeleteTaskOptions) error
- func (s *DefaultService) GetContainer(ctx context.Context, id string) (ContainerInfo, error)
- func (s *DefaultService) GetContainerMetrics(ctx context.Context, containerID string) (ContainerMetrics, error)
- func (s *DefaultService) GetImage(ctx context.Context, ref string) (ImageInfo, error)
- func (s *DefaultService) GetTaskInfo(ctx context.Context, containerID string) (TaskInfo, error)
- func (s *DefaultService) ListContainers(ctx context.Context) ([]ContainerInfo, error)
- func (s *DefaultService) ListContainersByLabel(ctx context.Context, key, value string) ([]ContainerInfo, error)
- func (s *DefaultService) ListImages(ctx context.Context) ([]ImageInfo, error)
- func (s *DefaultService) ListSnapshots(ctx context.Context, req ListSnapshotsRequest) ([]SnapshotInfo, error)
- func (s *DefaultService) ListTasks(ctx context.Context, opts *ListTasksOptions) ([]TaskInfo, error)
- func (s *DefaultService) PrepareSnapshot(ctx context.Context, req PrepareSnapshotRequest) error
- func (s *DefaultService) PullImage(ctx context.Context, ref string, opts *PullImageOptions) (ImageInfo, error)
- func (s *DefaultService) RemoveNetwork(ctx context.Context, req NetworkRequest) error
- func (*DefaultService) ResolveRemoteDigest(ctx context.Context, ref string) (string, error)
- func (s *DefaultService) RestoreContainer(ctx context.Context, req CreateContainerRequest) (ContainerInfo, error)
- func (s *DefaultService) SetupNetwork(ctx context.Context, req NetworkRequest) (NetworkResult, error)
- func (s *DefaultService) SnapshotMounts(ctx context.Context, snapshotter, key string) ([]MountInfo, error)
- func (s *DefaultService) SnapshotUsage(ctx context.Context, snapshotter, key string) (SnapshotUsage, error)
- func (s *DefaultService) StartContainer(ctx context.Context, containerID string, _ *StartTaskOptions) error
- func (s *DefaultService) StopContainer(ctx context.Context, containerID string, opts *StopTaskOptions) error
- type DeleteContainerOptions
- type DeleteImageOptions
- type DeleteTaskOptions
- type ImageInfo
- type LayerStatus
- type ListSnapshotsRequest
- type ListTasksOptions
- type MemoryMetrics
- type MountInfo
- type MountSpec
- type NetworkJoinTarget
- type NetworkRequest
- type NetworkResult
- type PrepareSnapshotRequest
- type PullImageOptions
- type PullProgress
- type ResourceLimits
- type RuntimeInfo
- type SnapshotInfo
- type SnapshotRef
- type SnapshotUsage
- type StartTaskOptions
- type StopTaskOptions
- type StorageRef
- type TaskInfo
- type TaskStatus
Constants ¶
View Source
const ( DefaultSocketPath = containerapi.DefaultSocketPath DefaultNamespace = containerapi.DefaultNamespace TaskStatusUnknown = containerapi.TaskStatusUnknown TaskStatusCreated = containerapi.TaskStatusCreated TaskStatusRunning = containerapi.TaskStatusRunning TaskStatusStopped = containerapi.TaskStatusStopped TaskStatusPaused = containerapi.TaskStatusPaused )
Variables ¶
View Source
var ( ErrInvalidArgument = containerapi.ErrInvalidArgument ErrNotSupported = containerapi.ErrNotSupported ErrNotFound = containerapi.ErrNotFound ErrAlreadyExists = containerapi.ErrAlreadyExists ErrRuntime = containerapi.ErrRuntime )
View Source
var ErrTaskStopTimeout = errors.New("timeout waiting for task to stop")
Functions ¶
func ResolveConfSource ¶
ResolveConfSource returns a host path to mount as /etc/resolv.conf. If systemd-resolved config is available, use it. Otherwise write a fallback resolv.conf under dataDir and return that path.
Types ¶
type CPUMetrics ¶
type CPUMetrics = containerapi.CPUMetrics
type CommitSnapshotRequest ¶
type CommitSnapshotRequest = containerapi.CommitSnapshotRequest
type ContainerInfo ¶
type ContainerInfo = containerapi.ContainerInfo
type ContainerMetrics ¶
type ContainerMetrics = containerapi.ContainerMetrics
type ContainerSpec ¶
type ContainerSpec = containerapi.ContainerSpec
type CreateContainerRequest ¶
type CreateContainerRequest = containerapi.CreateContainerRequest
type DefaultService ¶
type DefaultService struct {
// contains filtered or unexported fields
}
func NewDefaultService ¶
func NewDefaultService(log *slog.Logger, client *containerd.Client, cfg config.Config) *DefaultService
func NewService ¶
func NewService(log *slog.Logger, client *containerd.Client, cfg config.Config) *DefaultService
func (*DefaultService) CheckNetwork ¶
func (s *DefaultService) CheckNetwork(ctx context.Context, req NetworkRequest) error
func (*DefaultService) CommitSnapshot ¶
func (s *DefaultService) CommitSnapshot(ctx context.Context, req CommitSnapshotRequest) error
func (*DefaultService) CreateContainer ¶
func (s *DefaultService) CreateContainer(ctx context.Context, req CreateContainerRequest) (ContainerInfo, error)
func (*DefaultService) DeleteContainer ¶
func (s *DefaultService) DeleteContainer(ctx context.Context, id string, opts *DeleteContainerOptions) error
func (*DefaultService) DeleteImage ¶
func (s *DefaultService) DeleteImage(ctx context.Context, ref string, opts *DeleteImageOptions) error
func (*DefaultService) DeleteTask ¶
func (s *DefaultService) DeleteTask(ctx context.Context, containerID string, opts *DeleteTaskOptions) error
func (*DefaultService) GetContainer ¶
func (s *DefaultService) GetContainer(ctx context.Context, id string) (ContainerInfo, error)
func (*DefaultService) GetContainerMetrics ¶
func (s *DefaultService) GetContainerMetrics(ctx context.Context, containerID string) (ContainerMetrics, error)
func (*DefaultService) GetTaskInfo ¶
func (*DefaultService) ListContainers ¶
func (s *DefaultService) ListContainers(ctx context.Context) ([]ContainerInfo, error)
func (*DefaultService) ListContainersByLabel ¶
func (s *DefaultService) ListContainersByLabel(ctx context.Context, key, value string) ([]ContainerInfo, error)
func (*DefaultService) ListImages ¶
func (s *DefaultService) ListImages(ctx context.Context) ([]ImageInfo, error)
func (*DefaultService) ListSnapshots ¶
func (s *DefaultService) ListSnapshots(ctx context.Context, req ListSnapshotsRequest) ([]SnapshotInfo, error)
func (*DefaultService) ListTasks ¶
func (s *DefaultService) ListTasks(ctx context.Context, opts *ListTasksOptions) ([]TaskInfo, error)
func (*DefaultService) PrepareSnapshot ¶
func (s *DefaultService) PrepareSnapshot(ctx context.Context, req PrepareSnapshotRequest) error
func (*DefaultService) PullImage ¶
func (s *DefaultService) PullImage(ctx context.Context, ref string, opts *PullImageOptions) (ImageInfo, error)
func (*DefaultService) RemoveNetwork ¶
func (s *DefaultService) RemoveNetwork(ctx context.Context, req NetworkRequest) error
func (*DefaultService) ResolveRemoteDigest ¶
func (*DefaultService) RestoreContainer ¶
func (s *DefaultService) RestoreContainer(ctx context.Context, req CreateContainerRequest) (ContainerInfo, error)
func (*DefaultService) SetupNetwork ¶
func (s *DefaultService) SetupNetwork(ctx context.Context, req NetworkRequest) (NetworkResult, error)
func (*DefaultService) SnapshotMounts ¶
func (*DefaultService) SnapshotUsage ¶
func (s *DefaultService) SnapshotUsage(ctx context.Context, snapshotter, key string) (SnapshotUsage, error)
func (*DefaultService) StartContainer ¶
func (s *DefaultService) StartContainer(ctx context.Context, containerID string, _ *StartTaskOptions) error
func (*DefaultService) StopContainer ¶
func (s *DefaultService) StopContainer(ctx context.Context, containerID string, opts *StopTaskOptions) error
type DeleteContainerOptions ¶
type DeleteContainerOptions = containerapi.DeleteContainerOptions
type DeleteImageOptions ¶
type DeleteImageOptions = containerapi.DeleteImageOptions
type DeleteTaskOptions ¶
type DeleteTaskOptions = containerapi.DeleteTaskOptions
type ImageInfo ¶
type ImageInfo = containerapi.ImageInfo
type LayerStatus ¶
type LayerStatus = containerapi.LayerStatus
type ListSnapshotsRequest ¶
type ListSnapshotsRequest = containerapi.ListSnapshotsRequest
type ListTasksOptions ¶
type ListTasksOptions = containerapi.ListTasksOptions
type MemoryMetrics ¶
type MemoryMetrics = containerapi.MemoryMetrics
type MountInfo ¶
type MountInfo = containerapi.MountInfo
type MountSpec ¶
type MountSpec = containerapi.MountSpec
func TimezoneSpec ¶
TimezoneSpec returns environment variables that propagate the host timezone into the container without relying on file bind mounts like /etc/localtime. File mounts can fail for workspace containers when the target path is absent in the unpacked rootfs, while TZ is sufficient for Go, Node, and most tools.
type NetworkJoinTarget ¶
type NetworkJoinTarget = containerapi.NetworkJoinTarget
type NetworkRequest ¶
type NetworkRequest = containerapi.NetworkRequest
type NetworkResult ¶
type NetworkResult = containerapi.NetworkResult
type PrepareSnapshotRequest ¶
type PrepareSnapshotRequest = containerapi.PrepareSnapshotRequest
type PullImageOptions ¶
type PullImageOptions = containerapi.PullImageOptions
type PullProgress ¶
type PullProgress = containerapi.PullProgress
type ResourceLimits ¶
type ResourceLimits = containerapi.ResourceLimits
type RuntimeInfo ¶
type RuntimeInfo = containerapi.RuntimeInfo
type SnapshotInfo ¶
type SnapshotInfo = containerapi.SnapshotInfo
type SnapshotRef ¶
type SnapshotRef = containerapi.SnapshotRef
type SnapshotUsage ¶
type SnapshotUsage = containerapi.SnapshotUsage
type StartTaskOptions ¶
type StartTaskOptions = containerapi.StartTaskOptions
type StopTaskOptions ¶
type StopTaskOptions = containerapi.StopTaskOptions
type StorageRef ¶
type StorageRef = containerapi.StorageRef
type TaskInfo ¶
type TaskInfo = containerapi.TaskInfo
type TaskStatus ¶
type TaskStatus = containerapi.TaskStatus
Click to show internal directories.
Click to hide internal directories.