Documentation
¶
Index ¶
- type ContainerInfo
- type Engine
- func (e *Engine) BinaryPath() string
- func (e *Engine) ContainerExec(ctx context.Context, nameOrID string, args []string, interactive bool) error
- func (e *Engine) ContainerInspect(ctx context.Context, nameOrID string) ([]byte, error)
- func (e *Engine) ContainerList(ctx context.Context, all bool) ([]ContainerInfo, error)
- func (e *Engine) ContainerLogs(ctx context.Context, nameOrID string, follow bool) error
- func (e *Engine) ContainerRemove(ctx context.Context, nameOrID string, force bool) error
- func (e *Engine) ContainerRun(ctx context.Context, args []string, interactive bool) error
- func (e *Engine) ContainerStart(ctx context.Context, nameOrID string) error
- func (e *Engine) ContainerStop(ctx context.Context, nameOrID string) error
- func (e *Engine) Exec(ctx context.Context, args ...string) ([]byte, []byte, error)
- func (e *Engine) ExecInteractive(ctx context.Context, args ...string) error
- func (e *Engine) ExecStream(ctx context.Context, args ...string) (io.ReadCloser, error)
- func (e *Engine) ImageBuild(ctx context.Context, args []string) error
- func (e *Engine) ImageList(ctx context.Context) ([]ImageInfo, error)
- func (e *Engine) ImagePull(ctx context.Context, image string) error
- func (e *Engine) ImagePush(ctx context.Context, image string) error
- func (e *Engine) ImageRemove(ctx context.Context, image string) error
- func (e *Engine) NetworkConnect(ctx context.Context, network, container string) error
- func (e *Engine) NetworkCreate(ctx context.Context, name string) error
- func (e *Engine) NetworkDisconnect(ctx context.Context, network, container string) error
- func (e *Engine) NetworkInspect(ctx context.Context, name string) ([]byte, error)
- func (e *Engine) NetworkList(ctx context.Context) ([]NetworkInfo, error)
- func (e *Engine) NetworkRemove(ctx context.Context, name string) error
- func (e *Engine) Validate() error
- func (e *Engine) VolumeCreate(ctx context.Context, name string) error
- func (e *Engine) VolumeInspect(ctx context.Context, name string) ([]byte, error)
- func (e *Engine) VolumeList(ctx context.Context) ([]VolumeInfo, error)
- func (e *Engine) VolumeRemove(ctx context.Context, name string) error
- type ImageInfo
- type InspectData
- type NerdctlRuntime
- func (n *NerdctlRuntime) BinaryPath() string
- func (n *NerdctlRuntime) ContainerExec(ctx context.Context, nameOrID string, args []string, interactive bool) error
- func (n *NerdctlRuntime) ContainerInspect(ctx context.Context, nameOrID string) ([]byte, error)
- func (n *NerdctlRuntime) ContainerList(ctx context.Context, all bool) ([]ContainerInfo, error)
- func (n *NerdctlRuntime) ContainerLogs(ctx context.Context, nameOrID string, follow bool) error
- func (n *NerdctlRuntime) ContainerRemove(ctx context.Context, nameOrID string, force bool) error
- func (n *NerdctlRuntime) ContainerRun(ctx context.Context, args []string, interactive bool) error
- func (n *NerdctlRuntime) ContainerStart(ctx context.Context, nameOrID string) error
- func (n *NerdctlRuntime) ContainerStop(ctx context.Context, nameOrID string) error
- func (n *NerdctlRuntime) Exec(ctx context.Context, args ...string) ([]byte, []byte, error)
- func (n *NerdctlRuntime) ExecInteractive(ctx context.Context, args ...string) error
- func (n *NerdctlRuntime) ExecStream(ctx context.Context, args ...string) (io.ReadCloser, error)
- func (n *NerdctlRuntime) ImageBuild(ctx context.Context, args []string) error
- func (n *NerdctlRuntime) ImageList(ctx context.Context) ([]ImageInfo, error)
- func (n *NerdctlRuntime) ImagePull(ctx context.Context, image string) error
- func (n *NerdctlRuntime) ImagePush(ctx context.Context, image string) error
- func (n *NerdctlRuntime) ImageRemove(ctx context.Context, image string) error
- func (n *NerdctlRuntime) NetworkConnect(ctx context.Context, network, container string) error
- func (n *NerdctlRuntime) NetworkCreate(ctx context.Context, name string) error
- func (n *NerdctlRuntime) NetworkDisconnect(ctx context.Context, network, container string) error
- func (n *NerdctlRuntime) NetworkInspect(ctx context.Context, name string) ([]byte, error)
- func (n *NerdctlRuntime) NetworkList(ctx context.Context) ([]NetworkInfo, error)
- func (n *NerdctlRuntime) NetworkRemove(ctx context.Context, name string) error
- func (n *NerdctlRuntime) Validate() error
- func (n *NerdctlRuntime) VolumeCreate(ctx context.Context, name string) error
- func (n *NerdctlRuntime) VolumeInspect(ctx context.Context, name string) ([]byte, error)
- func (n *NerdctlRuntime) VolumeList(ctx context.Context) ([]VolumeInfo, error)
- func (n *NerdctlRuntime) VolumeRemove(ctx context.Context, name string) error
- type NetworkInfo
- type Runtime
- type VolumeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerInfo ¶
type ContainerInfo struct {
ID string
Name string
Image string
State string
Status string
IP string
Ports string
Created time.Time
Command string
}
func ParseNerdctlContainerList ¶ added in v0.4.0
func ParseNerdctlContainerList(data []byte) ([]ContainerInfo, error)
type Engine ¶
type Engine struct {
Binary string
}
Engine is the Apple Container CLI backend (macOS).
func (*Engine) BinaryPath ¶ added in v0.4.0
func (*Engine) ContainerExec ¶
func (*Engine) ContainerInspect ¶
func (*Engine) ContainerList ¶
func (*Engine) ContainerLogs ¶
func (*Engine) ContainerRemove ¶
func (*Engine) ContainerRun ¶
func (*Engine) ContainerStart ¶
func (*Engine) ContainerStop ¶
func (*Engine) ExecInteractive ¶
func (*Engine) ExecStream ¶
func (*Engine) NetworkConnect ¶
func (*Engine) NetworkCreate ¶
func (*Engine) NetworkDisconnect ¶
func (*Engine) NetworkInspect ¶
func (*Engine) NetworkList ¶
func (e *Engine) NetworkList(ctx context.Context) ([]NetworkInfo, error)
func (*Engine) NetworkRemove ¶
func (*Engine) VolumeInspect ¶
func (*Engine) VolumeList ¶
func (e *Engine) VolumeList(ctx context.Context) ([]VolumeInfo, error)
type ImageInfo ¶
type ImageInfo struct {
ID string
Name string
Tag string
Digest string
Size string
Created time.Time
Arch string
}
func ParseNerdctlImageList ¶ added in v0.4.0
type InspectData ¶
type InspectData struct {
Raw []byte // raw JSON from `container inspect`
}
type NerdctlRuntime ¶ added in v0.4.0
type NerdctlRuntime struct {
Binary string
}
NerdctlRuntime is the containerd/nerdctl backend (Linux).
func NewNerdctl ¶ added in v0.4.0
func NewNerdctl(binary string) *NerdctlRuntime
func (*NerdctlRuntime) BinaryPath ¶ added in v0.4.0
func (n *NerdctlRuntime) BinaryPath() string
func (*NerdctlRuntime) ContainerExec ¶ added in v0.4.0
func (*NerdctlRuntime) ContainerInspect ¶ added in v0.4.0
func (*NerdctlRuntime) ContainerList ¶ added in v0.4.0
func (n *NerdctlRuntime) ContainerList(ctx context.Context, all bool) ([]ContainerInfo, error)
func (*NerdctlRuntime) ContainerLogs ¶ added in v0.4.0
func (*NerdctlRuntime) ContainerRemove ¶ added in v0.4.0
func (*NerdctlRuntime) ContainerRun ¶ added in v0.4.0
func (*NerdctlRuntime) ContainerStart ¶ added in v0.4.0
func (n *NerdctlRuntime) ContainerStart(ctx context.Context, nameOrID string) error
func (*NerdctlRuntime) ContainerStop ¶ added in v0.4.0
func (n *NerdctlRuntime) ContainerStop(ctx context.Context, nameOrID string) error
func (*NerdctlRuntime) ExecInteractive ¶ added in v0.4.0
func (n *NerdctlRuntime) ExecInteractive(ctx context.Context, args ...string) error
func (*NerdctlRuntime) ExecStream ¶ added in v0.4.0
func (n *NerdctlRuntime) ExecStream(ctx context.Context, args ...string) (io.ReadCloser, error)
func (*NerdctlRuntime) ImageBuild ¶ added in v0.4.0
func (n *NerdctlRuntime) ImageBuild(ctx context.Context, args []string) error
func (*NerdctlRuntime) ImageList ¶ added in v0.4.0
func (n *NerdctlRuntime) ImageList(ctx context.Context) ([]ImageInfo, error)
func (*NerdctlRuntime) ImagePull ¶ added in v0.4.0
func (n *NerdctlRuntime) ImagePull(ctx context.Context, image string) error
func (*NerdctlRuntime) ImagePush ¶ added in v0.4.0
func (n *NerdctlRuntime) ImagePush(ctx context.Context, image string) error
func (*NerdctlRuntime) ImageRemove ¶ added in v0.4.0
func (n *NerdctlRuntime) ImageRemove(ctx context.Context, image string) error
func (*NerdctlRuntime) NetworkConnect ¶ added in v0.4.0
func (n *NerdctlRuntime) NetworkConnect(ctx context.Context, network, container string) error
func (*NerdctlRuntime) NetworkCreate ¶ added in v0.4.0
func (n *NerdctlRuntime) NetworkCreate(ctx context.Context, name string) error
func (*NerdctlRuntime) NetworkDisconnect ¶ added in v0.4.0
func (n *NerdctlRuntime) NetworkDisconnect(ctx context.Context, network, container string) error
func (*NerdctlRuntime) NetworkInspect ¶ added in v0.4.0
func (*NerdctlRuntime) NetworkList ¶ added in v0.4.0
func (n *NerdctlRuntime) NetworkList(ctx context.Context) ([]NetworkInfo, error)
func (*NerdctlRuntime) NetworkRemove ¶ added in v0.4.0
func (n *NerdctlRuntime) NetworkRemove(ctx context.Context, name string) error
func (*NerdctlRuntime) Validate ¶ added in v0.4.0
func (n *NerdctlRuntime) Validate() error
func (*NerdctlRuntime) VolumeCreate ¶ added in v0.4.0
func (n *NerdctlRuntime) VolumeCreate(ctx context.Context, name string) error
func (*NerdctlRuntime) VolumeInspect ¶ added in v0.4.0
func (*NerdctlRuntime) VolumeList ¶ added in v0.4.0
func (n *NerdctlRuntime) VolumeList(ctx context.Context) ([]VolumeInfo, error)
func (*NerdctlRuntime) VolumeRemove ¶ added in v0.4.0
func (n *NerdctlRuntime) VolumeRemove(ctx context.Context, name string) error
type NetworkInfo ¶
func ParseNerdctlNetworkList ¶ added in v0.4.0
func ParseNerdctlNetworkList(data []byte) ([]NetworkInfo, error)
type Runtime ¶ added in v0.4.0
type Runtime interface {
// Validate checks that the backend binary exists and is usable.
Validate() error
// BinaryPath returns the path to the underlying runtime binary.
BinaryPath() string
// Low-level exec — used by API server and commands that need raw CLI access.
Exec(ctx context.Context, args ...string) ([]byte, []byte, error)
ExecInteractive(ctx context.Context, args ...string) error
ExecStream(ctx context.Context, args ...string) (io.ReadCloser, error)
// Container lifecycle
ContainerRun(ctx context.Context, args []string, interactive bool) error
ContainerList(ctx context.Context, all bool) ([]ContainerInfo, error)
ContainerStop(ctx context.Context, nameOrID string) error
ContainerStart(ctx context.Context, nameOrID string) error
ContainerRemove(ctx context.Context, nameOrID string, force bool) error
ContainerExec(ctx context.Context, nameOrID string, args []string, interactive bool) error
ContainerLogs(ctx context.Context, nameOrID string, follow bool) error
ContainerInspect(ctx context.Context, nameOrID string) ([]byte, error)
// Images
ImagePull(ctx context.Context, image string) error
ImagePush(ctx context.Context, image string) error
ImageList(ctx context.Context) ([]ImageInfo, error)
ImageRemove(ctx context.Context, image string) error
ImageBuild(ctx context.Context, args []string) error
// Networks
NetworkCreate(ctx context.Context, name string) error
NetworkList(ctx context.Context) ([]NetworkInfo, error)
NetworkRemove(ctx context.Context, name string) error
NetworkConnect(ctx context.Context, network, container string) error
NetworkDisconnect(ctx context.Context, network, container string) error
NetworkInspect(ctx context.Context, name string) ([]byte, error)
// Volumes
VolumeCreate(ctx context.Context, name string) error
VolumeList(ctx context.Context) ([]VolumeInfo, error)
VolumeRemove(ctx context.Context, name string) error
VolumeInspect(ctx context.Context, name string) ([]byte, error)
}
Runtime is the interface that all container backends must implement. The current Engine struct (Apple Container CLI) implements this interface. Future backends (e.g., NerdctlRuntime) will also implement it.
func DetectRuntime ¶ added in v0.4.0
DetectRuntime auto-detects the appropriate container runtime for the current platform. On macOS it uses Apple's container CLI, on Linux it uses nerdctl (containerd).
type VolumeInfo ¶
func ParseNerdctlVolumeList ¶ added in v0.4.0
func ParseNerdctlVolumeList(data []byte) ([]VolumeInfo, error)
Click to show internal directories.
Click to hide internal directories.