Documentation
¶
Index ¶
- Constants
- func DisconnectSession(spaceId string)
- func ExpireSession(spaceId string)
- func ListenAndServe(listen string, tlsConfig *tls.Config)
- func QueueSpaceReconcile(spaceId string)
- func RemoveSession(spaceId string)
- type Session
- func (s *Session) Ping() bool
- func (s *Session) RegisterLogListener() (string, chan *msg.LogMessage)
- func (s *Session) SendCopyFile(copyCmd *msg.CopyFileMessage) (chan *msg.CopyFileResponse, error)
- func (s *Session) SendExecuteScript(execMsg *msg.ExecuteScriptMessage) (chan *msg.ExecuteScriptResponse, error)
- func (s *Session) SendExecuteScriptStream(execMsg *msg.ExecuteScriptStreamMessage) (io.ReadWriteCloser, error)
- func (s *Session) SendPortForward(portCmd *msg.PortForwardRequest) (*msg.PortForwardResponse, error)
- func (s *Session) SendPortList() (*msg.PortListResponse, error)
- func (s *Session) SendPortStop(portCmd *msg.PortStopRequest) (*msg.PortStopResponse, error)
- func (s *Session) SendRunCommand(runCmd *msg.RunCommandMessage) (chan *msg.RunCommandResponse, error)
- func (s *Session) SendUpdateAuthorizedKeys(sshKeys []string, sshPrivateKey string, githubUsernames []string) error
- func (s *Session) SendUpdateShell(shell string) error
- func (s *Session) UnregisterLogListener(listenerId string)
Constants ¶
View Source
const ( AGENT_SCHEDULE_INTERVAL = 1 * time.Minute AGENT_LIVENESS_CHECK_INTERVAL = 10 * time.Second AGENT_LIVENESS_TIMEOUT = 30 * time.Second )
View Source
const (
AGENT_SESSION_LOG_HISTORY = 1000 // Number of lines of log history to keep
)
Variables ¶
This section is empty.
Functions ¶
func DisconnectSession ¶ added in v0.25.0
func DisconnectSession(spaceId string)
func ExpireSession ¶ added in v0.25.0
func ExpireSession(spaceId string)
func ListenAndServe ¶
func QueueSpaceReconcile ¶ added in v0.25.0
func QueueSpaceReconcile(spaceId string)
func RemoveSession ¶
func RemoveSession(spaceId string)
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
CPUPercent float64
MemoryUsedBytes uint64
MemoryLimitBytes uint64
DiskUsedBytes uint64
DiskLimitBytes uint64
ActivityWriteCount uint32
ActivityCreateCount uint32
ActivityDeleteCount uint32
ActivityRenameCount uint32
ActivityDistinctPaths uint32
LastActivityAtUnix int64
LastStateAt time.Time
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
// contains filtered or unexported fields
}
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) SendCopyFile ¶ added in v0.19.0
func (s *Session) SendCopyFile(copyCmd *msg.CopyFileMessage) (chan *msg.CopyFileResponse, error)
func (*Session) SendExecuteScript ¶ added in v0.23.0
func (s *Session) SendExecuteScript(execMsg *msg.ExecuteScriptMessage) (chan *msg.ExecuteScriptResponse, error)
func (*Session) SendExecuteScriptStream ¶ added in v0.23.0
func (s *Session) SendExecuteScriptStream(execMsg *msg.ExecuteScriptStreamMessage) (io.ReadWriteCloser, error)
func (*Session) SendPortForward ¶ added in v0.22.2
func (s *Session) SendPortForward(portCmd *msg.PortForwardRequest) (*msg.PortForwardResponse, error)
func (*Session) SendPortList ¶ added in v0.22.2
func (s *Session) SendPortList() (*msg.PortListResponse, error)
func (*Session) SendPortStop ¶ added in v0.22.2
func (s *Session) SendPortStop(portCmd *msg.PortStopRequest) (*msg.PortStopResponse, error)
func (*Session) SendRunCommand ¶ added in v0.19.0
func (s *Session) SendRunCommand(runCmd *msg.RunCommandMessage) (chan *msg.RunCommandResponse, error)
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.