ssh

package module
v0.0.0-...-ab02719 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 8 Imported by: 0

README

ssh

A FAIRE.

Licence

MIT.


Copyright (c) 2021 mls-361.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client AFAIRE.

func (*Client) Connect

func (c *Client) Connect(logger Logger) (*Connection, error)

Connect AFAIRE.

type Clients

type Clients map[string]map[string]*Client

Clients AFAIRE.

func NewClients

func NewClients(config []*Config, crypto Crypto) (Clients, error)

NewClients AFAIRE.

func (Clients) Connect

func (c Clients) Connect(host, username string, logger Logger) (*Connection, error)

Connect AFAIRE.

type Config

type Config struct {
	Host       string
	Port       int
	Username   string
	Password   string
	KeyFile    string
	Passphrase string
	Timeout    time.Duration
}

Config AFAIRE.

func (*Config) NewClient

func (cfg *Config) NewClient() (*Client, error)

NewClient AFAIRE.

type Connection

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

Connection AFAIRE.

func (*Connection) Disconnect

func (conn *Connection) Disconnect()

Disconnect AFAIRE.

func (*Connection) Host

func (conn *Connection) Host() string

Host AFAIRE.

func (*Connection) NewSession

func (conn *Connection) NewSession() (*Session, error)

NewSession AFAIRE.

func (*Connection) Port

func (conn *Connection) Port() int

Port AFAIRE.

func (*Connection) ReadStream

func (conn *Connection) ReadStream(cmd string, timeout time.Duration) (*Stream, error)

ReadStream AFAIRE.

func (*Connection) Username

func (conn *Connection) Username() string

Username AFAIRE.

type Crypto

type Crypto interface {
	DecryptString(text string) (string, error)
}

Crypto AFAIRE.

type Logger

type Logger interface {
	Debug(msg string, kv ...interface{})
}

Logger AFAIRE.

type Session

type Session struct {
	*ssh.Session
	// contains filtered or unexported fields
}

Session AFAIRE.

func (*Session) CombinedOutput

func (s *Session) CombinedOutput(cmd string) ([]byte, error)

CombinedOutput AFAIRE.

func (*Session) Output

func (s *Session) Output(cmd string) ([]byte, error)

Output AFAIRE.

func (*Session) Run

func (s *Session) Run(cmd string) error

Run AFAIRE.

func (*Session) Start

func (s *Session) Start(cmd string) error

Start AFAIRE.

type Stream

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

Stream AFAIRE.

func (*Stream) Close

func (s *Stream) Close()

Close AFAIRE.

func (*Stream) Done

func (s *Stream) Done() <-chan bool

Done AFAIRE.

func (*Stream) Err

func (s *Stream) Err() error

Err AFAIRE.

func (*Stream) Stderr

func (s *Stream) Stderr() <-chan string

Stderr AFAIRE.

func (*Stream) Stdout

func (s *Stream) Stdout() <-chan string

Stdout AFAIRE.

Jump to

Keyboard shortcuts

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