Documentation
¶
Index ¶
- Constants
- type AgentInfo
- type FileDownloadParams
- type FileDownloadResult
- type FileUploadParams
- type FileUploadResult
- type ListAgentsParams
- type ListAgentsResult
- type ListSessionsParams
- type ListSessionsResult
- type RegisterParams
- type RegisterResult
- type SessionDataParams
- type SessionInfo
- type SessionResizeParams
- type SessionStartParams
- type SessionStopParams
- type VersionCheckParams
- type VersionCheckResult
Constants ¶
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 ¶
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 ¶
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.