ssh

package
v2.0.0-...-459835f Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: BSD-2-Clause-Views Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

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

Transport implements RFC6242 for implementing NETCONF protocol over SSH.

func Dial

func Dial(ctx context.Context, network, addr string, config *ssh.ClientConfig) (*Transport, error)

Dial will connect to a ssh server and issues a transport, it's used as a convience function as essnetial is the same as

	c, err := ssh.Dial(network, addr, config)
 	if err != nil { /* ... handle error ... */ }
 	t, err := NewTransport(c)

When the transport is closed the underlying connection is also closed.

func NewTransport

func NewTransport(client *ssh.Client) (*Transport, error)

NewTransport will create a new ssh transport as defined in RFC6242 for use with netconf. Unlike Dial, the underlying client will not be automatically closed when the transport is closed (however any sessions and subsystems are still closed).

func (*Transport) Close

func (t *Transport) Close() error

Close will close the underlying transport. If the connection was created with Dial then then underlying ssh.Client is closed as well. If not only the sessions is closed.

Jump to

Keyboard shortcuts

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