Documentation
¶
Overview ¶
package applecontainer implements helper functions and types for use with apple's container library. See https://github.com/apple/container for more information about how to install it and how it works.
Index ¶
- type ContainerSvc
- func (c *ContainerSvc) Create(ctx context.Context, opts *options.CreateContainer, imageName string, ...) (string, error)
- func (c *ContainerSvc) Delete(ctx context.Context, opts *options.DeleteContainer, id string) (string, error)
- func (c *ContainerSvc) Exec(ctx context.Context, opts *options.ExecContainer, containerID, command string, ...) (string, error)
- func (c *ContainerSvc) ExecStream(ctx context.Context, opts *options.ExecContainer, containerID, command string, ...) (func() error, error)
- func (c *ContainerSvc) Export(ctx context.Context, opts *options.ExportContainer, id string) (string, error)
- func (c *ContainerSvc) Inspect(ctx context.Context, id ...string) ([]types.Container, error)
- func (c *ContainerSvc) Kill(ctx context.Context, opts *options.KillContainer, id ...string) (string, error)
- func (c *ContainerSvc) List(ctx context.Context) ([]types.Container, error)
- func (c *ContainerSvc) Logs(ctx context.Context, opts *options.ContainerLogs, id string) (io.ReadCloser, func() error, error)
- func (c *ContainerSvc) Run(ctx context.Context, opts *options.RunContainer, imageName, command string, ...) (func() error, error)
- func (c *ContainerSvc) Start(ctx context.Context, opts *options.StartContainer, id string) (string, error)
- func (c *ContainerSvc) Stats(ctx context.Context, id ...string) ([]types.ContainerStats, error)
- func (c *ContainerSvc) Stop(ctx context.Context, opts *options.StopContainer, id string) (string, error)
- type ImagesSvc
- type NetworkSvc
- func (s *NetworkSvc) Create(ctx context.Context, name string) (string, error)
- func (s *NetworkSvc) Delete(ctx context.Context, name string) (string, error)
- func (s *NetworkSvc) Inspect(ctx context.Context, name string) ([]types.Network, error)
- func (s *NetworkSvc) List(ctx context.Context) ([]types.Network, error)
- type SystemSvc
- func (s *SystemSvc) DNSCreate(ctx context.Context, domain string) error
- func (s *SystemSvc) DNSList(ctx context.Context) ([]string, error)
- func (s *SystemSvc) Logs(ctx context.Context, opts *options.SystemLogs) (io.ReadCloser, func() error, error)
- func (s *SystemSvc) PropertyGet(ctx context.Context, id string) (string, error)
- func (s *SystemSvc) PropertyList(ctx context.Context) ([]types.SystemProperty, error)
- func (s *SystemSvc) PropertySet(ctx context.Context, id, value string) error
- func (s *SystemSvc) Start(ctx context.Context, opts *options.SystemStart) (string, error)
- func (s *SystemSvc) Status(ctx context.Context, opts *options.SystemStatus) (string, error)
- func (s *SystemSvc) Stop(ctx context.Context, opts *options.SystemStop) (string, error)
- func (s *SystemSvc) Version(ctx context.Context) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerSvc ¶
type ContainerSvc struct{}
var Containers ContainerSvc
Containers is a service interface to interact with apple containers.
func (*ContainerSvc) Create ¶
func (c *ContainerSvc) Create(ctx context.Context, opts *options.CreateContainer, imageName string, initArgs []string) (string, error)
Create creates a new container with the given options, name and init args. It returns the ID of the new container instance.
func (*ContainerSvc) Delete ¶
func (c *ContainerSvc) Delete(ctx context.Context, opts *options.DeleteContainer, id string) (string, error)
Delete deletes a container instance with a given ID. It returns the delete command output, or an error.
func (*ContainerSvc) Exec ¶
func (c *ContainerSvc) Exec(ctx context.Context, opts *options.ExecContainer, containerID, command string, env []string, cmdArgs ...string) (string, error)
func (*ContainerSvc) ExecStream ¶
func (c *ContainerSvc) ExecStream(ctx context.Context, opts *options.ExecContainer, containerID, command string, env []string, stdin io.Reader, stdout, stderr io.Writer, cmdArgs ...string) (func() error, error)
ExecStream executes a command in a running container instance, with stdio streams.
func (*ContainerSvc) Export ¶
func (c *ContainerSvc) Export(ctx context.Context, opts *options.ExportContainer, id string) (string, error)
func (*ContainerSvc) Inspect ¶
Inspect returns details about the requested container IDs, or an error.
func (*ContainerSvc) Kill ¶
func (c *ContainerSvc) Kill(ctx context.Context, opts *options.KillContainer, id ...string) (string, error)
Kill kills containers
func (*ContainerSvc) Logs ¶
func (c *ContainerSvc) Logs(ctx context.Context, opts *options.ContainerLogs, id string) (io.ReadCloser, func() error, error)
Logs returns an io.ReadCloser for streaming log output and a wait func that blocks on the command's completion, or an error.
func (*ContainerSvc) Run ¶
func (c *ContainerSvc) Run(ctx context.Context, opts *options.RunContainer, imageName, command string, env []string, stdin io.Reader, stdout, stderr io.Writer, cmdArgs ...string) (func() error, error)
Run runs a command in a new container instance based on the given image.
func (*ContainerSvc) Start ¶
func (c *ContainerSvc) Start(ctx context.Context, opts *options.StartContainer, id string) (string, error)
Start starts a container instance with a given ID. It returns the start command output, or an error.
func (*ContainerSvc) Stats ¶
func (c *ContainerSvc) Stats(ctx context.Context, id ...string) ([]types.ContainerStats, error)
func (*ContainerSvc) Stop ¶
func (c *ContainerSvc) Stop(ctx context.Context, opts *options.StopContainer, id string) (string, error)
Stop stops a container instance with a given ID. It returns the stop command output, or an error.
type ImagesSvc ¶
type ImagesSvc struct{}
var Images ImagesSvc
Images is a service interface to interact with apple container images.
func (*ImagesSvc) Inspect ¶
Inspect returns details about the image with the given name, or an error.
func (*ImagesSvc) Pull ¶
Pull pulls the image with the given name and returns a wait func to release the cmd resources, or returns an error. It runs the command under a PTY so the 'container' subprocess sees a TTY and emits live progress output. All subprocess output is copied to w. The returned wait func is idempotent.
type NetworkSvc ¶
type NetworkSvc struct{}
var Network NetworkSvc
Network is a service interface to interact with the apple container system.
type SystemSvc ¶
type SystemSvc struct{}
var System SystemSvc
System is a service interface to interact with the apple container system.
func (*SystemSvc) Logs ¶
func (s *SystemSvc) Logs(ctx context.Context, opts *options.SystemLogs) (io.ReadCloser, func() error, error)
Logs returns an io.ReadCloser for streaming log output and a wait func that blocks on the command's completion, or an error.
func (*SystemSvc) PropertyGet ¶
PropertyGet gets a container system property value.
func (*SystemSvc) PropertyList ¶
PropertyList returns a slice of system property values, or an error.
func (*SystemSvc) PropertySet ¶
PropertySet sets a container system property value.
func (*SystemSvc) Start ¶
Start starts the container system. It returns the output of the command, or an error.
Directories
¶
| Path | Synopsis |
|---|---|
|
package options defines structs for the flagsets passed to various `container` commands.
|
package options defines structs for the flagsets passed to various `container` commands. |
|
package types defines structs for unmashaling the output from various `container` commands.
|
package types defines structs for unmashaling the output from various `container` commands. |