Documentation
¶
Index ¶
Constants ¶
View Source
const ( AGENT_SESSION_GC_INTERVAL = 5 * time.Second AGENT_SESSION_TIMEOUT = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
func RemoveSession ¶
func RemoveSession(spaceId string)
removeSession removes a session associated with the given spaceId. It locks the sessionMutex to ensure thread safety, checks if a session exists for the provided spaceId, and if so, closes the MuxSession if it is not nil. Finally, it deletes the session from the sessions map and unlocks the sessionMutex.
Parameters:
- spaceId: The identifier for the space whose session is to be removed.
Types ¶
type Session ¶
type Session struct { Id string `msgpack:"space_id"` Version string `msgpack:"version"` HasCodeServer bool `msgpack:"has_code_server"` SSHPort int `msgpack:"ssh_port"` VNCHttpPort int `msgpack:"vnc_http_port"` HasTerminal bool `msgpack:"has_terminal"` TcpPorts map[string]string `msgpack:"tcp_ports"` HttpPorts map[string]string `msgpack:"http_ports"` HasVSCodeTunnel bool `msgpack:"has_vscode_tunnel"` VSCodeTunnelName string `msgpack:"vscode_tunnel_name"` ExpiresAfter time.Time `msgpack:"-"` MuxSession *yamux.Session `msgpack:"-"` }
Struct holding the state / registration information of an agent
func GetSession ¶
GetSession retrieves the agent session associated with the given spaceId. If an agent session is found for the provided spaceId, it returns the session; otherwise, it returns nil.
func NewSession ¶
creates a new agent session
Click to show internal directories.
Click to hide internal directories.