testutil

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFactory added in v0.1.2

type HandlerFactory func(t assert.TestingT) SSHHandler

HandlerFactory is a test function that will deliver an SSHHandler.

type SSHHandler added in v0.1.1

type SSHHandler interface {
	// Handler is a function that handles i/o to/from an SSH channel
	Handle(t assert.TestingT, ch ssh.Channel)
}

SSHHandler is the interface that is implemented to handle an SSH channel.

type SSHServer

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

SSHServer represents a test SSH Server

func NewSSHServer

func NewSSHServer(t assert.TestingT, uname, password string) *SSHServer

NewSSHServer deflivers a new test SSH Server, with a Handler that simply echoes lines received. The server implements password authentication with the given credentials.

func NewSSHServerHandler added in v0.1.1

func NewSSHServerHandler(t assert.TestingT, uname, password string, factory HandlerFactory) *SSHServer

NewSSHServerHandler deflivers a new test SSH Server, with a custom channel handler. The server implements password authentication with the given credentials.

func (*SSHServer) Close

func (ts *SSHServer) Close()

Close closes any resources used by the server.

func (*SSHServer) Port

func (ts *SSHServer) Port() int

Port delivers the tcp port number on which the server is listening.

Jump to

Keyboard shortcuts

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