Documentation
¶
Index ¶
- Constants
- func ListenAndServe(listen string, tlsConfig *tls.Config)
- func RemoveSession(spaceId string)
- type Session
- func (s *Session) Ping() bool
- func (s *Session) RegisterLogListener() (string, chan *msg.LogMessage)
- func (s *Session) SendUpdateAuthorizedKeys(sshKeys []string, githubUsernames []string) error
- func (s *Session) SendUpdateShell(shell string) error
- func (s *Session) UnregisterLogListener(listenerId string)
Constants ¶
View Source
const ( AGENT_SESSION_LOG_HISTORY = 1000 // Number of lines of log history to keep AGENT_TOKEN_DESCRIPTION = "agent token" )
View Source
const (
AGENT_SCHEDULE_INTERVAL = 1 * time.Minute
)
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
Version string
HasCodeServer bool
SSHPort int
VNCHttpPort int
HasTerminal bool
TcpPorts map[string]string
HttpPorts map[string]string
HasVSCodeTunnel bool
VSCodeTunnelName string
MuxSession *yamux.Session
// The log history
LogHistoryMutex *sync.RWMutex
LogHistory []*msg.LogMessage
// The list of listeners for log messages
LogListenersMutex *sync.RWMutex
LogListeners map[string]chan *msg.LogMessage
}
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
func (*Session) RegisterLogListener ¶ added in v0.11.5
func (s *Session) RegisterLogListener() (string, chan *msg.LogMessage)
func (*Session) SendUpdateAuthorizedKeys ¶
func (*Session) SendUpdateShell ¶ added in v0.11.5
func (*Session) UnregisterLogListener ¶ added in v0.11.5
Click to show internal directories.
Click to hide internal directories.