ssh

package
v0.0.0-...-0eae148 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSSHClient

func NewSSHClient(conf ClientConfig) (*ssh.Client, error)

Types

type AuthMethod

type AuthMethod string
const (
	PASSWORD  AuthMethod = "password"
	PUBLICKEY AuthMethod = "publickey"
)

type ClientConfig

type ClientConfig struct {
	AuthMethod AuthMethod    `json:"auth_method"`
	Host       string        `json:"host"`
	User       string        `json:"user"`
	Password   string        `json:"password"`
	Key        string        `json:"key"`
	Timeout    time.Duration `json:"timeout"`
}

func ClientConfigPassword

func ClientConfigPassword(host, user, Password string) *ClientConfig

func ClientConfigPublicKey

func ClientConfigPublicKey(host, user, key string) *ClientConfig

type MessageResize

type MessageResize struct {
	Resize  bool `json:"resize"`
	Columns int  `json:"columns"`
	Rows    int  `json:"rows"`
}

type Turn

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

func NewTurn

func NewTurn(ws *websocket.Conn, client *ssh.Client) (*Turn, error)

func (*Turn) Close

func (t *Turn) Close() error

func (*Turn) Handle

func (t *Turn) Handle(context context.Context) error

func (*Turn) Wait

func (t *Turn) Wait() error

func (*Turn) Write

func (t *Turn) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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