server

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FLAG_DIR_TEMPLATE                   = "%s/.k8shell/flags"
	SystemInfoCollectionIntervalSeconds = 30
)
View Source
const API_VERSION = "v1"
View Source
const JWT_VERIFIER_PUBLIC_KEY_ENV = "JWT_VERIFIER_PUBLIC_KEY"
View Source
const JWT_VERIFIER_SIGNING_METHOD_ENV = "JWT_VERIFIER_SIGNING_METHOD"
View Source
const USER_DISPLAY_NAME_ENV = "USERFULLNAME"
View Source
const USER_EMAIL_ENV = "USEREMAIL"
View Source
const USER_GID_ENV = "USER_GID"
View Source
const USER_UID_ENV = "USER_UID"

Variables

This section is empty.

Functions

This section is empty.

Types

type RESTService

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

func NewRESTService

func NewRESTService(unixSocketPath string, user *models.User, server *Server) (*RESTService, error)

NewRESTAPI creates a new REST API service

func (*RESTService) AttachShell

func (a *RESTService) AttachShell(w http.ResponseWriter, r *http.Request)

AttachShell hijacks the HTTP connection and bridges it directly to the PTY of the requested shell session (replaying scrollback first).

func (*RESTService) DetachShell

func (a *RESTService) DetachShell(w http.ResponseWriter, r *http.Request)

DetachShell signals the currently attached client of a session to detach. An optional JSON body { "ttl": "30m" } sets a per-session TTL override.

func (*RESTService) GetAppLogs

func (a *RESTService) GetAppLogs(w http.ResponseWriter, r *http.Request)

GetAppLogs returns (and can stream) the latest logs for a given app.

func (*RESTService) GetAppsStatus

func (a *RESTService) GetAppsStatus(w http.ResponseWriter, r *http.Request)

GetAppsStatus returns the status of all configured apps.

func (*RESTService) GetCredsHelper

func (a *RESTService) GetCredsHelper(w http.ResponseWriter, r *http.Request)

func (*RESTService) GetIdentity

func (a *RESTService) GetIdentity(w http.ResponseWriter, r *http.Request)

func (*RESTService) GetInitScripts

func (a *RESTService) GetInitScripts(w http.ResponseWriter, r *http.Request)

GetInitScripts returns a JSON snapshot of all init script states.

func (*RESTService) GetLogs

func (a *RESTService) GetLogs(w http.ResponseWriter, r *http.Request)

func (*RESTService) GetSessions

func (a *RESTService) GetSessions(w http.ResponseWriter, r *http.Request)

func (*RESTService) GetSplash

func (a *RESTService) GetSplash(w http.ResponseWriter, r *http.Request)

func (*RESTService) GetStreams

func (a *RESTService) GetStreams(w http.ResponseWriter, r *http.Request)

func (*RESTService) GetSystemInfo

func (a *RESTService) GetSystemInfo(w http.ResponseWriter, r *http.Request)

func (*RESTService) InstallApp

func (a *RESTService) InstallApp(w http.ResponseWriter, r *http.Request)

InstallApp installs the specified app (asynchronously).

func (*RESTService) ListDetachedShells

func (a *RESTService) ListDetachedShells(w http.ResponseWriter, r *http.Request)

ListDetachedShells returns a JSON list of PTY shell sessions with no attached client.

func (*RESTService) ResizeShell

func (a *RESTService) ResizeShell(w http.ResponseWriter, r *http.Request)

ResizeShell resizes the PTY of a shell session (works whether attached or detached).

func (*RESTService) Serve

func (a *RESTService) Serve(ctx context.Context)

func (*RESTService) Shutdown

func (a *RESTService) Shutdown(w http.ResponseWriter, r *http.Request)

func (*RESTService) StartApp

func (a *RESTService) StartApp(w http.ResponseWriter, r *http.Request)

StartApp starts supervising and running the specified app.

func (*RESTService) StopApp

func (a *RESTService) StopApp(w http.ResponseWriter, r *http.Request)

StopApp stops supervising and (if running) stops the specified app.

func (*RESTService) ValidateK8shelldFile

func (a *RESTService) ValidateK8shelldFile(w http.ResponseWriter, r *http.Request)

type Server

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

func NewServer

func NewServer(cfg *config.Config, restApiUnixSocketPath string, testMode bool) (*Server, error)

func (*Server) Serve

func (s *Server) Serve()

Jump to

Keyboard shortcuts

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