Documentation ¶
Index ¶
- Constants
- func NewConnection(cfg *connection.Config, logger hclog.Logger) connection.Connection
- type SSH
- func (s *SSH) Close() error
- func (s *SSH) Closed() chan bool
- func (s *SSH) Exit()
- func (s *SSH) Expect(ctx context.Context, req *connection.Request) *connection.Response
- func (s *SSH) GetConfig() *connection.Config
- func (s *SSH) GetData(request *connection.Request)
- func (s *SSH) GetHost() string
- func (s *SSH) GetRegexPrompt() string
- func (s *SSH) Heartbeat() connection.Heartbeat
- func (s *SSH) Init() error
- func (s *SSH) LastUsed() (bool, time.Time)
- func (s *SSH) Login() error
- func (s *SSH) NewRequest(cmd string, expect []string, errors []string) *connection.Request
- func (s *SSH) Ping() error
- func (s *SSH) Reader()
- func (s *SSH) Renewed() chan uint
- func (s *SSH) SetHost(host string)
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) 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) GetRegexPrompt ¶
func (*SSH) Heartbeat ¶
func (s *SSH) Heartbeat() connection.Heartbeat
func (*SSH) NewRequest ¶
Click to show internal directories.
Click to hide internal directories.