Help us shape the future of Go! Take the 2026 Go Developer Survey

cocoon

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Prefix is the node endpoint scheme this engine serves.
	Prefix = "cocoon://"
	Type   = "cocoon"
)

Variables

This section is empty.

Functions

func MakeClient

func MakeClient(_ context.Context, config coretypes.Config, nodename, endpoint string) (engine.API, error)

Types

type Engine

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

Engine runs VMs through the cocoon CLI over SSH.

func (*Engine) BuildRefs

func (e *Engine) BuildRefs(_ context.Context, opts *enginetypes.BuildRefOptions) []string

func (*Engine) CloseConn

func (e *Engine) CloseConn() error

func (*Engine) ExecExitCode

func (e *Engine) ExecExitCode(_ context.Context, _, execID string) (int, error)

func (*Engine) ExecResize

func (e *Engine) ExecResize(context.Context, string, uint, uint) error

func (*Engine) Execute

func (e *Engine) Execute(ctx context.Context, ID string, config *enginetypes.ExecConfig) (execID string, stdout, stderr io.ReadCloser, stdin io.WriteCloser, err error)

Execute runs the command through cocoon-agent in pipe mode; a pty is projecteru2/core#660.

func (*Engine) GetParams

func (e *Engine) GetParams() *enginetypes.Params

func (*Engine) ImageBuild

func (e *Engine) ImageBuild(context.Context, io.Reader, []string, string) (io.ReadCloser, error)

func (*Engine) ImageBuildCachePrune

func (e *Engine) ImageBuildCachePrune(context.Context, bool) (uint64, error)

func (*Engine) ImageBuildFromExist

func (e *Engine) ImageBuildFromExist(context.Context, string, []string, string) (string, error)

func (*Engine) ImageList

func (e *Engine) ImageList(ctx context.Context, image string) ([]*enginetypes.Image, error)

func (*Engine) ImageLocalDigests

func (e *Engine) ImageLocalDigests(ctx context.Context, image string) ([]string, error)

func (*Engine) ImagePull

func (e *Engine) ImagePull(ctx context.Context, ref string, _ bool) (io.ReadCloser, error)

ImagePull hands a registry ref or a cloud-image url to cocoon; a parts artifact goes through oras and import.

func (*Engine) ImagePush

func (e *Engine) ImagePush(context.Context, string) (io.ReadCloser, error)

func (*Engine) ImageRemoteDigest

func (e *Engine) ImageRemoteDigest(ctx context.Context, image string) (string, error)

ImageRemoteDigest asks the registry through oras; a cloud image url is its own digest.

func (*Engine) ImageRemove

func (e *Engine) ImageRemove(ctx context.Context, image string, _, _ bool) ([]string, error)

func (*Engine) ImagesPrune

func (e *Engine) ImagesPrune(context.Context) error

func (*Engine) Info

func (e *Engine) Info(ctx context.Context) (*enginetypes.Info, error)

func (*Engine) NetworkConnect

func (e *Engine) NetworkConnect(context.Context, string, string, string, string) ([]string, error)

NetworkConnect is not a CNI operation: a vm's network is attached when it is created.

func (*Engine) NetworkDisconnect

func (e *Engine) NetworkDisconnect(context.Context, string, string, bool) error

func (*Engine) NetworkList

func (e *Engine) NetworkList(ctx context.Context, drivers []string) ([]*enginetypes.Network, error)

func (*Engine) Ping

func (e *Engine) Ping(ctx context.Context) error

func (*Engine) VerifyNode added in v0.1.4

func (e *Engine) VerifyNode(ctx context.Context) error

func (*Engine) VirtualizationAttach

func (e *Engine) VirtualizationAttach(ctx context.Context, ID string, _, stdin bool) (io.ReadCloser, io.ReadCloser, io.WriteCloser, error)

VirtualizationAttach without stdin is the journald follow; the console needs a pty (projecteru2/core#660).

func (*Engine) VirtualizationCopyChunkTo

func (e *Engine) VirtualizationCopyChunkTo(ctx context.Context, ID, target string, size int64, content io.Reader, uid, gid int, mode int64) error

VirtualizationCopyChunkTo streams one tar entry into `tar -x -P`; the absolute name makes tar create the parents.

func (*Engine) VirtualizationCopyFrom

func (e *Engine) VirtualizationCopyFrom(ctx context.Context, ID, path string) (content []byte, uid, gid int, mode int64, err error)

func (*Engine) VirtualizationInspect

func (e *Engine) VirtualizationInspect(ctx context.Context, ID string) (*enginetypes.VirtualizationInfo, error)

func (*Engine) VirtualizationLogs

func (e *Engine) VirtualizationLogs(ctx context.Context, opts *enginetypes.VirtualizationLogStreamOptions) (stdout, stderr io.ReadCloser, err error)

VirtualizationLogs reads what eru-agent copied from the guest console into journald.

func (*Engine) VirtualizationRemove

func (e *Engine) VirtualizationRemove(ctx context.Context, ID string, _, force bool) error

func (*Engine) VirtualizationResize

func (e *Engine) VirtualizationResize(context.Context, string, uint, uint) error

func (*Engine) VirtualizationResume

func (e *Engine) VirtualizationResume(ctx context.Context, ID string) error

func (*Engine) VirtualizationStart

func (e *Engine) VirtualizationStart(ctx context.Context, ID string) error

func (*Engine) VirtualizationStop

func (e *Engine) VirtualizationStop(ctx context.Context, ID string, gracefulTimeout time.Duration) error

func (*Engine) VirtualizationSuspend

func (e *Engine) VirtualizationSuspend(ctx context.Context, ID string) error

func (*Engine) VirtualizationUpdateResource

func (e *Engine) VirtualizationUpdateResource(ctx context.Context, ID string, engineParams resourcetypes.Resources) error

func (*Engine) VirtualizationWait

func (e *Engine) VirtualizationWait(ctx context.Context, ID, _ string) (*enginetypes.VirtualizationWaitResult, error)

VirtualizationWait follows the status stream until the guest is no longer running; a VM has no exit code.

type RawArgs

type RawArgs struct {
	OS string `json:"os"` // "windows" boots a Windows guest
}

RawArgs carries vm-specific workload options through core untouched.

Jump to

Keyboard shortcuts

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