Browse Source

En cours de développement

master
mls-361 3 months ago
parent
commit
de0aa7813b
  1. 9
      client.go

9
client.go

@ -7,6 +7,7 @@
package ssh
import (
"forge.chapril.org/mls-361/errors"
"forge.chapril.org/mls-361/logger"
"golang.org/x/crypto/ssh"
)
@ -24,7 +25,13 @@ type Client struct {
func (c *Client) Connect(logger logger.Logger) (*Connection, error) {
ssh, err := ssh.Dial("tcp", c.addr, c.config)
if err != nil {
return nil, err
return nil, errors.WithMessage( ////////////////////////////////////////////////////////////////////////////////
err,
"no ssh connection",
"host", c.host,
"port", c.port,
"username", c.username,
)
}
conn := &Connection{

Loading…
Cancel
Save