Rename to SSHServer

This commit is contained in:
Edmundo Gonzalez 2021-08-26 23:04:05 +00:00 committed by GitHub
parent a89c17a564
commit 18ab421b08

View file

@ -5,26 +5,26 @@ import (
"errors"
)
type SshRpc struct {
type SSHServer struct {
client *Client
}
func NewSSHRpc(client *Client) (*SshRpc, error) {
func NewSSHServer(client *Client) (*SSHServer, error) {
if !client.hasJoined() {
return nil, errors.New("client must join before creating server")
}
return &SshRpc{client: client}, nil
return &SSHServer{client: client}, nil
}
type SshServerStartResult struct {
type SSHServerStartResult struct {
Result bool `json:"result"`
ServerPort string `json:"serverPort"`
User string `json:"user"`
Message string `json:"message"`
}
func (s *SshRpc) StartRemoteServer(ctx context.Context) (SshServerStartResult, error) {
var response SshServerStartResult
func (s *SSHServer) StartRemoteServer(ctx context.Context) (SSHServerStartResult, error) {
var response SSHServerStartResult
if err := s.client.rpc.do(ctx, "ISshServerHostService.startRemoteServer", []string{}, &response); err != nil {
return response, err