protocol

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MethodVersionCheck  = "version.check"
	MethodAgentRegister = "agent.register"
	MethodAgentList     = "agent.list"
	MethodSessionStart  = "session.start"
	MethodSessionData   = "session.data"
	MethodSessionStop   = "session.stop"
	MethodSessionResize = "session.resize"
	MethodSessionList   = "session.list"
	MethodFileDownload  = "file.download"
	MethodFileUpload    = "file.upload"
)

Supported JSON-RPC 2.0 methods.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInfo

type AgentInfo struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	SessionCount int    `json:"session_count"`
}

AgentInfo contains information about a device.

type FileDownloadParams

type FileDownloadParams struct {
	AgentID    string `json:"agent_id"`
	RemotePath string `json:"remote_path"`
}

FileDownloadParams parameters to download a file from agent.

type FileDownloadResult

type FileDownloadResult struct {
	Success  bool   `json:"success"`
	Filename string `json:"filename"`
	Content  string `json:"content"` // base64 encoded
	Size     int64  `json:"size"`
	Error    string `json:"error,omitempty"`
}

FileDownloadResult result of file download.

type FileUploadParams

type FileUploadParams struct {
	AgentID    string `json:"agent_id"`
	RemotePath string `json:"remote_path"`
	Content    string `json:"content"`        // base64 encoded
	Mode       uint32 `json:"mode,omitempty"` // file permissions
}

FileUploadParams parameters to upload a file to agent.

type FileUploadResult

type FileUploadResult struct {
	Success bool   `json:"success"`
	Size    int64  `json:"size"`
	Error   string `json:"error,omitempty"`
}

FileUploadResult result of file upload.

type ListAgentsParams

type ListAgentsParams struct{}

ListAgentsParams is empty as it requires no parameters.

type ListAgentsResult

type ListAgentsResult struct {
	Agents []AgentInfo `json:"agents"`
	Count  int         `json:"count"`
}

ListAgentsResult is the result of listing devices.

type ListSessionsParams

type ListSessionsParams struct{}

ListSessionsParams parameters for listing sessions.

type ListSessionsResult

type ListSessionsResult struct {
	Sessions []SessionInfo `json:"sessions"`
	Count    int           `json:"count"`
}

ListSessionsResult result of listing sessions.

type RegisterParams

type RegisterParams struct {
	AgentID  string `json:"agent_id"`
	Name     string `json:"name"`
	Hostname string `json:"hostname,omitempty"`
	Platform string `json:"platform,omitempty"`
}

RegisterParams contains the registration parameters for a device.

type RegisterResult

type RegisterResult struct {
	Success bool   `json:"success"`
	Message string `json:"message,omitempty"`
}

RegisterResult is the response to device registration.

type SessionDataParams

type SessionDataParams struct {
	AgentID   string `json:"agent_id,omitempty"` // for client->server routing
	SessionID string `json:"session_id"`
	Payload   string `json:"payload"` // data in base64 or string
}

SessionDataParams contains session I/O data.

type SessionInfo

type SessionInfo struct {
	SessionID string `json:"session_id"`
	AgentID   string `json:"agent_id"`
}

SessionInfo information about a session.

type SessionResizeParams

type SessionResizeParams struct {
	AgentID   string `json:"agent_id,omitempty"` // for client->server routing
	SessionID string `json:"session_id"`
	Rows      uint16 `json:"rows"`
	Cols      uint16 `json:"cols"`
}

SessionResizeParams contains the parameters to resize the terminal.

type SessionStartParams

type SessionStartParams struct {
	AgentID   string `json:"agent_id,omitempty"` // for client->server routing
	SessionID string `json:"session_id"`
	Shell     string `json:"shell,omitempty"` // default: /bin/bash
}

SessionStartParams contains the parameters to start a session.

type SessionStopParams

type SessionStopParams struct {
	AgentID   string `json:"agent_id,omitempty"` // for client->server routing
	SessionID string `json:"session_id"`
}

SessionStopParams contains the parameters to stop a session.

type VersionCheckParams

type VersionCheckParams struct {
	Version   string `json:"version"`
	GitCommit string `json:"git_commit,omitempty"`
}

VersionCheckParams contains version information.

type VersionCheckResult

type VersionCheckResult struct {
	Compatible bool   `json:"compatible"`
	Version    string `json:"version"`
	Message    string `json:"message,omitempty"`
}

VersionCheckResult is the response to version check.

Jump to

Keyboard shortcuts

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