ssh

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionRequest

type ConnectionRequest struct {
	Host string `json:"host"`
	Port int    `json:"port"`
	User string `json:"user"`
	Pass string `json:"pass"`
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController() *Controller

func (*Controller) CleanupClient

func (c *Controller) CleanupClient(ctx context.Context)

func (*Controller) CloseClient

func (c *Controller) CloseClient(req Request, client *ssh.Client)

func (*Controller) CreateShell

func (c *Controller) CreateShell(ctx context.Context, req Request) (session *Session, err error)

func (*Controller) FetchClient

func (c *Controller) FetchClient(req Request) (client *ssh.Client, err error)

type Request

type Request struct {
	Route   []ConnectionRequest `json:"route"`
	Command string              `json:"init"`
	Rows    int                 `json:"rows"`
	Cols    int                 `json:"cols"`
}

func (Request) Key

func (req Request) Key() string

type Session

type Session struct {
	Req Request
	// contains filtered or unexported fields
}

func (*Session) Close

func (s *Session) Close() (err error)

func (*Session) GetSize

func (s *Session) GetSize() (rows, cols int)

func (*Session) Read

func (s *Session) Read(data []byte) (int, error)

func (*Session) Resize

func (s *Session) Resize(rows, cols int)

func (*Session) Serve

func (s *Session) Serve(ctx context.Context) (err error)

func (*Session) Start

func (s *Session) Start(ctx context.Context) (err error)

func (*Session) Write

func (s *Session) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL