cli

package
v0.0.0-...-5a82f7d Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Cat command implementation for the CLI client

LS command implementation for the CLI client

PS command implementation for the CLI client

Rm command implementation for the CLI client

Upload command implementation for the CLI client using HTTP PUT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatCommand

func CatCommand(conn *websocket.Conn, args []string)

CatCommand handles the cat command execution

func DownloadCommand

func DownloadCommand(args []string)

func LsCommand

func LsCommand(conn *websocket.Conn, args []string)

lsCommand handles the ls command execution

func PsCommand

func PsCommand(conn *websocket.Conn, tree bool)

psCommand handles the ps command execution

func RmCommand

func RmCommand(conn *websocket.Conn, args []string, recursive bool, force bool)

rmCommand handles the rm command execution

func RunShellSession

func RunShellSession(conn *websocket.Conn)

runShellSession starts an interactive shell session using WebSocket streaming.

func UploadCommand

func UploadCommand(args []string)

Types

type CatMessage

type CatMessage struct {
	Type     string `json:"type"`
	Command  string `json:"command,omitempty"`
	Output   string `json:"output,omitempty"`
	Error    string `json:"error,omitempty"`
	Filename string `json:"filename,omitempty"`
}

CatMessage structure for WebSocket communication (matches server)

type LSMessage

type LSMessage struct {
	Type    string `json:"type"`
	Command string `json:"command,omitempty"`
	Output  string `json:"output,omitempty"`
	Error   string `json:"error,omitempty"`
}

LSMessage structure for WebSocket communication (matches server)

type PSMessage

type PSMessage struct {
	Type    string `json:"type"`
	Command string `json:"command,omitempty"`
	Output  string `json:"output,omitempty"`
	Error   string `json:"error,omitempty"`
}

PSMessage structure for WebSocket communication (matches server)

type RmMessage

type RmMessage struct {
	Type    string `json:"type"`
	Command string `json:"command,omitempty"`
	Output  string `json:"output,omitempty"`
	Error   string `json:"error,omitempty"`
	Removed int    `json:"removed,omitempty"`
}

RmMessage structure for WebSocket communication (matches server)

type WSMessage

type WSMessage struct {
	Type string `json:"type"`
	Data []byte `json:"data,omitempty"`
	Rows int    `json:"rows,omitempty"`
	Cols int    `json:"cols,omitempty"`
}

Message structure for WebSocket communication

Jump to

Keyboard shortcuts

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