containers

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCreateTimeout = errors.New("invalid container create timeout value")

Functions

func Attach added in v0.10.0

func Attach(id string, stdin io.Reader, stdout io.Writer, attachReady chan bool, detachKey string) error

Attach will attach to a running container.

func Checkpoint added in v0.7.0

func Checkpoint(id string, opts CntCheckPointOptions) (string, error)

Checkpoint a running container.

func Commit added in v0.5.0

func Commit(id string, opts CntCommitOptions) (string, error)

Commit creates an image from a container's changes.

func Create

func Create(opts CreateOptions) ([]string, error)

Create creates a new container.

func Diff

func Diff(id string) ([]string, error)

Diff returns the diff of the specified container ID.

func Exec added in v0.2.0

func Exec(sessionID string, opts ExecOption)

Exec returns the diff of the specified container ID.

func HealthCheck added in v0.9.0

func HealthCheck(id string) (string, error)

HealthCheck runs the health check of a container.

func Inspect

func Inspect(id string) (string, error)

Inspect returns inspect results of the specific container.

func Kill

func Kill(id string) error

Kill sends SIGKILL signal to container processes.

func List

func List() ([]entities.ListContainer, error)

List returns list of containers information.

func Logs

func Logs(id string) ([]string, error)

Logs returns container's log.

func NewExecSession added in v0.2.0

func NewExecSession(id string, opts ExecOption) (string, error)

NewExecSession creates a new session and returns its id.

func Pause

func Pause(id string) error

Pause pauses a pod's containers.

func Port

func Port(id string) ([]string, error)

Port retrurn ports mapping of the container.

func Prune

func Prune() ([]string, error)

Prune removes all non running containers.

func Remove

func Remove(id string) ([]string, error)

Remove removes the container.

func Rename

func Rename(id string, name string) error

Rename renames existing container's name.

func ResizeContainerTTY added in v0.10.0

func ResizeContainerTTY(id string, width int, height int) error

ResizeContainerTTY resize the attached container tty size.

func ResizeExecTty added in v0.2.0

func ResizeExecTty(id string, height int, width int)

ResizeExecTty resizes exec session tty.

func Restore added in v0.7.0

func Restore(opts CntRestoreOptions) (string, error)

Restore performs container checkpoint restore.

func Start

func Start(id string) error

Start starts a container.

func Stats added in v0.2.0

Stats returns live stream of containers stats result.

func Status added in v0.2.0

func Status(id string) (string, error)

Status returns status of a container.

func Stop

func Stop(id string) error

Stop starts a container.

func Top

func Top(id string) ([][]string, error)

Top returns running processes on the container.

func Unpause

func Unpause(id string) error

Unpause pauses a pod's containers.

Types

type CntCheckPointOptions added in v0.7.0

type CntCheckPointOptions struct {
	Export         string
	CreateImage    string
	IgnoreRootFs   bool
	Keep           bool
	LeaveRunning   bool
	TCPEstablished bool
	PrintStats     bool
	PreCheckpoint  bool
	WithPrevious   bool
	FileLocks      bool
}

CntCheckPointOptions is container checkpoint options.

type CntCommitOptions added in v0.5.0

type CntCommitOptions struct {
	Author  string
	Changes []string
	Message string
	Format  string
	Pause   bool
	Squash  bool
	Image   string
}

CntCommitOptions containers commit options.

type CntRestoreOptions added in v0.7.0

type CntRestoreOptions struct {
	ContainerID     string
	PodID           string
	Name            string
	Publish         []string
	Import          string
	Keep            bool
	IgnoreStaticIP  bool
	IgnoreStaticMAC bool
	FileLocks       bool
	PrintStats      bool
	TCPEstablished  bool
	IgnoreVolumes   bool
	IgnoreRootfs    bool
}

CntRestoreOptions is container restore options.

type CreateOptions

type CreateOptions struct {
	Name                  string
	Labels                []string
	Image                 string
	Remove                bool
	Privileged            bool
	Timeout               string
	WorkDir               string
	EnvVars               []string
	EnvFile               []string
	EnvMerge              []string
	UnsetEnv              []string
	EnvHost               bool
	UnsetEnvAll           bool
	Umask                 string
	User                  string
	HostUsers             []string
	GroupEntry            string
	PasswdEntry           string
	Pod                   string
	Hostname              string
	IPAddress             string
	Network               string
	MacAddress            string
	Publish               []string
	Expose                []string
	PublishAll            bool
	DNSServer             []string
	DNSOptions            []string
	DNSSearchDomain       []string
	Volume                string
	ImageVolume           string
	Mount                 string
	SelinuxOpts           []string
	ApparmorProfile       string
	Seccomp               string
	SecNoNewPriv          bool
	SecMask               string
	SecUnmask             string
	HealthCmd             string
	HealthInterval        string
	HealthRetries         string
	HealthStartPeroid     string
	HealthTimeout         string
	HealthOnFailure       string
	HealthStartupCmd      string
	HealthStartupInterval string
	HealthStartupRetries  string
	HealthStartupSuccess  string
	HealthStartupTimeout  string
}

CreateOptions container create options.

type ExecOption added in v0.2.0

type ExecOption struct {
	Cmd          []string
	Tty          bool
	Detach       bool
	Interactive  bool
	Privileged   bool
	WorkDir      string
	EnvVariables []string
	EnvFile      []string
	User         string
	OutputStream io.Writer
	InputStream  *bufio.Reader
	TtyWidth     int
	TtyHeight    int
	DetachKeys   string
}

ExecOption container exec options.

Jump to

Keyboard shortcuts

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