msg

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSG_NONE = iota
	MSG_PING
	MSG_UPDATE_STATE
	MSG_UPDATE_AUTHORIZED_KEYS
	MSG_TERMINAL
	MSG_CODE_SERVER
	MSG_PROXY_TCP_PORT
	MSG_PROXY_VNC
	MSG_PROXY_HTTP
	MSG_VSCODE_TUNNEL_TERMINAL
)

enum of message types

View Source
const (
	MSG_TERMINAL_DATA = iota
	MSG_TERMINAL_RESIZE
)

Variables

This section is empty.

Functions

func ReadCommand

func ReadCommand(conn net.Conn) (byte, error)

func ReadMessage

func ReadMessage(conn net.Conn, v interface{}) error

func SendState

func SendState(conn net.Conn, spaceId string, hasCodeServer bool, sshPort int, vncHttpPort int, hasTerminal bool, tcpPorts *map[string]string, httpPorts *map[string]string, hasVSCodeTunnel bool, vscodeTunnelName string, ip string) error

func WriteCommand

func WriteCommand(conn net.Conn, cmdType byte) error

func WriteMessage

func WriteMessage(conn net.Conn, payload interface{}) error

Types

type AgentState

type AgentState struct {
	SpaceId          string
	HasCodeServer    bool
	SSHPort          int
	VNCHttpPort      int
	HasTerminal      bool
	TcpPorts         map[string]string
	HttpPorts        map[string]string
	HasVSCodeTunnel  bool
	VSCodeTunnelName string
	AgentIp          string
}

type HttpPort

type HttpPort struct {
	Port       uint16
	ServerName string
}

type Pong

type Pong struct {
	Payload string
}

type Register

type Register struct {
	SpaceId string
	Version string
}

message sent from an agent to the server to register itself

type RegisterResponse

type RegisterResponse struct {
	Version        string
	Success        bool
	SSHKey         string
	GitHubUsername string
}

message sent from the server to the agent in response to a register message

type TcpPort

type TcpPort struct {
	Port uint16
}

type Terminal

type Terminal struct {
	Shell string
}

message for terminal

type TerminalWindowSize

type TerminalWindowSize struct {
	Rows uint16 `json:"rows"`
	Cols uint16 `json:"cols"`
	X    uint16
	Y    uint16
}

type UpdateAuthorizedKeys

type UpdateAuthorizedKeys struct {
	SSHKey         string
	GitHubUsername string
}

message sent to update the authorized keys within an agent

Jump to

Keyboard shortcuts

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