sshnet

package
v0.0.0-...-13d6dd4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

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

Addr local sshnet address type

func (Addr) Network

func (a Addr) Network() string

Network returns address in compliance with net.Conn interface

func (Addr) String

func (a Addr) String() string

String returns address in compliance with net.Conn interface

type Conn

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

Conn sshnet Conn type, wraps an ssh connection/channel in a net.Conn compatible interface

func NewConn

func NewConn(sshConn *ssh.ServerConn, client ssh.Channel) Conn

NewConn takes the ssh connection/channel and wraps them in a Conn

func (*Conn) Close

func (c *Conn) Close() error

Close the connection

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

LocalAddr in compliance with net.Conn interface

func (*Conn) Read

func (c *Conn) Read(retBuf []byte) (int, error)

Read data in compliance with net.Conn interface

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

RemoteAddr in compliance with net.Conn interface

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

SetDeadline in compliance with net.Conn interface

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

SetReadDeadline in compliance with net.Conn interface

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

SetWriteDeadline in compliance with net.Conn interface

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

Write data in compliance with net.Conn interface

type Debug

type Debug bool

Debug make true to log debug messages

func (Debug) Println

func (d Debug) Println(v ...interface{})

Println a wrapper for debug.Println

type Listener

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

Listener the public structure of the sshnet listener

func Listen

func Listen(addr string) (*Listener, error)

Listen returns the listener data structure

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

Accept connections from the ssh channel connection queue

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

Addr returns the address

func (*Listener) Close

func (l *Listener) Close() error

Close the receive listener channel

func (*Listener) Dialer

func (l *Listener) Dialer(sshConn *ssh.ServerConn, client ssh.Channel)

Dialer connects an ssh channel for a connection to the listener

type Metrics

type Metrics struct {
	Accept        prometheus.Counter
	Close         prometheus.Counter
	Dialer        prometheus.Counter
	BytesRead     prometheus.Counter
	BytesWrittern prometheus.Counter
}

The Metrics that the module produces

Jump to

Keyboard shortcuts

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