wasmtime

package
v0.0.0-...-801fd6a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTopic

func GetTopic(e interface{}) string

GetTopic converts an event from an interface type to the specific event topic id

func NewBinaryCmd

func NewBinaryCmd(binaryURI *url.URL, id, ns string) *exec.Cmd

NewBinaryCmd returns a Cmd to be used to start a logging binary. The Cmd is generated from the provided uri, and the container ID and namespace are appended to the Cmd environment. ported from https://github.com/containerd/containerd/blob/v2.0.0/cmd/containerd-shim-runc-v2/process/io_util.go#L28

func NewPlatform

func NewPlatform() (stdio.Platform, error)

NewPlatform returns a linux platform for use with I/O operations

Types

type Container

type Container struct {

	// ID of the container
	ID string
	// Bundle path
	Bundle string
	// Root Remap
	RootRemap string
	// contains filtered or unexported fields
}

Container for operating on a runc container and its processes

func NewContainer

func NewContainer(ctx context.Context, platform stdio.Platform, r *taskAPI.CreateTaskRequest, ec chan<- Exit) (c *Container, err error)

NewContainer returns a new runc container

func (*Container) All

func (c *Container) All() (o []*Process)

All processes in the container

func (*Container) Cgroup

func (c *Container) Cgroup() cgroup1.Cgroup

Cgroup of the container

func (*Container) CgroupSet

func (c *Container) CgroupSet(cg cgroup1.Cgroup)

CgroupSet sets the cgroup to the container

func (*Container) Checkpoint

Checkpoint the container

func (*Container) CloseIO

func (c *Container) CloseIO(ctx context.Context, r *taskAPI.CloseIORequest) error

CloseIO of a process

func (*Container) Delete

func (c *Container) Delete(ctx context.Context, r *taskAPI.DeleteRequest) (*Process, error)

Delete the container or a process by id

func (*Container) Exec

Exec an additional process

func (*Container) ExecdProcesses

func (c *Container) ExecdProcesses() (o []*Process)

ExecdProcesses added to the container

func (*Container) HasPid

func (c *Container) HasPid(pid int) bool

HasPid returns true if the container owns a specific pid

func (*Container) Kill

func (c *Container) Kill(ctx context.Context, r *taskAPI.KillRequest) error

Kill a process

func (*Container) Pause

func (c *Container) Pause(ctx context.Context) error

Pause the container

func (*Container) Pid

func (c *Container) Pid() int

Pid of the main process of a container

func (*Container) Process

func (c *Container) Process(id string) (*Process, error)

Process returns the process by id

func (*Container) ProcessAdd

func (c *Container) ProcessAdd(process *Process)

ProcessAdd adds a new process to the container

func (*Container) ProcessExists

func (c *Container) ProcessExists(id string) bool

ProcessExists returns true if the process by id exists

func (*Container) ProcessRemove

func (c *Container) ProcessRemove(id string)

ProcessRemove removes the process by id from the container

func (*Container) ResizePty

func (c *Container) ResizePty(ctx context.Context, r *taskAPI.ResizePtyRequest) error

ResizePty of a process

func (*Container) Resume

func (c *Container) Resume(ctx context.Context) error

Resume the container

func (*Container) Start

func (c *Container) Start(ctx context.Context, r *taskAPI.StartRequest) (*Process, error)

Start a container process

func (*Container) Update

Update the resource information of a running container

type Exit

type Exit struct {
	Pid    int
	Status int
}

type Process

type Process struct {
	// contains filtered or unexported fields
}

func (*Process) Delete

func (p *Process) Delete(context.Context) error

func (*Process) ExitStatus

func (p *Process) ExitStatus() int

func (*Process) ExitedAt

func (p *Process) ExitedAt() time.Time

func (*Process) ID

func (p *Process) ID() string

func (*Process) Kill

func (p *Process) Kill(context.Context, uint32, bool) error

func (*Process) Pid

func (p *Process) Pid() int

func (*Process) Resize

func (p *Process) Resize(ws console.WinSize) error

func (*Process) SetExited

func (p *Process) SetExited(status int)

func (*Process) Start

func (p *Process) Start(ctx context.Context) (err error)

func (*Process) Status

func (p *Process) Status(context.Context) (string, error)

func (*Process) Stdin

func (p *Process) Stdin() io.Closer

func (*Process) Stdio

func (p *Process) Stdio() stdio.Stdio

func (*Process) Wait

func (p *Process) Wait()

Jump to

Keyboard shortcuts

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