ssh

package
v0.0.0-...-fc64511 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegexPrompt = "\\n[<\\[](\\S+)[>#\\]]$"
	DefaultTTL         = time.Second * 30
	DefaultPort        = 22
)

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(cfg *connection.Config, logger hclog.Logger) connection.Connection

Types

type SSH

type SSH struct {
	*connection.Config
	ConnectionClosedChan  chan bool
	ConnectionRenewedChan chan uint

	*sync.Mutex

	Stdout io.Reader
	Stdin  io.WriteCloser
	Buffer string
	Data   chan string
	// contains filtered or unexported fields
}

func (*SSH) Close

func (s *SSH) Close() error

func (*SSH) Closed

func (s *SSH) Closed() chan bool

func (*SSH) Exit

func (s *SSH) Exit()

func (*SSH) Expect

func (s *SSH) Expect(ctx context.Context, req *connection.Request) *connection.Response

func (*SSH) GetConfig

func (s *SSH) GetConfig() *connection.Config

func (*SSH) GetData

func (s *SSH) GetData(request *connection.Request)

func (*SSH) GetHost

func (s *SSH) GetHost() string

func (*SSH) GetRegexPrompt

func (s *SSH) GetRegexPrompt() string

func (*SSH) Heartbeat

func (s *SSH) Heartbeat() connection.Heartbeat

func (*SSH) Init

func (s *SSH) Init() error

func (*SSH) LastUsed

func (s *SSH) LastUsed() (bool, time.Time)

func (*SSH) Login

func (s *SSH) Login() error

func (*SSH) NewRequest

func (s *SSH) NewRequest(cmd string, expect []string, errors []string) *connection.Request

func (*SSH) Ping

func (s *SSH) Ping() error

func (*SSH) Reader

func (s *SSH) Reader()

func (*SSH) Renewed

func (s *SSH) Renewed() chan uint

func (*SSH) SetHost

func (s *SSH) SetHost(host string)

Jump to

Keyboard shortcuts

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