ssh server docs

This commit is contained in:
Jose Garcia 2021-09-14 23:57:40 +00:00 committed by GitHub
parent 467c695122
commit 497b45e4e2

View file

@ -4,14 +4,20 @@ import (
"context"
)
// A SSHServer handles starting the remote SSH server.
// If there is no SSH server available it installs one.
type SSHServer struct {
session *Session
}
// SSHServer returns a new SSHServer from the LiveShare Session.
func (session *Session) SSHServer() *SSHServer {
return &SSHServer{session: session}
}
// SSHServerStartResult contains whether or not the start of the SSH server was
// successful. If it succeeded the server port and user is included. If it failed,
// it contains an explanation message.
type SSHServerStartResult struct {
Result bool `json:"result"`
ServerPort string `json:"serverPort"`
@ -19,6 +25,7 @@ type SSHServerStartResult struct {
Message string `json:"message"`
}
// StartRemoteServer starts or install the remote SSH server and returns the result.
func (s *SSHServer) StartRemoteServer(ctx context.Context) (*SSHServerStartResult, error) {
var response SSHServerStartResult