ssh

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

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

Dial will connect to ssh server and issues a transport, it's used as a convenience function as essentially 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, opts ...Opt) (transport.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).

Types

type Opt

type Opt func(*Transport)

func WithDebugCapture

func WithDebugCapture(in, out io.Writer) Opt

type Transport

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

Transport implements RFC6242 for implementing NETCONF protocol over SSH.

func (*Transport) Close

func (t *Transport) Close() error

Close will close the underlying transport. Underlying ssh.Client is closed if managed by transport (created by Dial).

Jump to

Keyboard shortcuts

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