instancemanager

package module
v0.0.0-...-1be267e Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: GPL-3.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	Id         string
	Registry   string
	Tag        string
	Command    string
	WorkingDir string
	Ports      []Port
}

type InstanceManager

type InstanceManager interface {
	// General
	// Read Only
	GetImage(ctx context.Context, imageId string) (*Image, error)
	ListImages(ctx context.Context) ([]Image, error)
	GetServer(ctx context.Context, serverId string) (*Server, error)
	ListServers(ctx context.Context) ([]Server, error)

	// State Changing
	StartServer(ctx context.Context, serverId string, imageId string, command string, ports []models.Port) error
	StopServer(ctx context.Context, serverId string) error

	CreateServer(ctx context.Context) (*Server, error)
	DeleteServer(ctx context.Context, serverId string) error

	// Status Changing
	InteractiveTerminal(ctx context.Context, serverId string) (*TerminalConnection, error)

	// Read Only
	GetFileBrowser(ctx context.Context, serverId string) (*models.FileBrowser, error)
	ListFileBrowsers(ctx context.Context) ([]models.FileBrowser, error)
	GetServerIdFromFileBrowserUrl(ctx context.Context, serverId string) (string, error)

	// Status Changing
	StartFileBrowser(ctx context.Context, serverId string) (*models.FileBrowser, error)
	StopFileBrowser(ctx context.Context, serverId string) error
}

type Port

type Port struct {
	Number   uint16
	Protocol models.PortProtocol
}

type Server

type Server struct {
	Id             string
	Running        bool
	RunningCommand string
	RunningImage   *models.Image
	Ports          []models.Port
	Domain         string
}

type TerminalConnection

type TerminalConnection struct {
	Conn        net.Conn
	ResizerFunc func(width uint, height uint) error
}

Directories

Path Synopsis
docker module

Jump to

Keyboard shortcuts

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