manager

package
v0.0.0-...-c456e04 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager is the central piece responsible for starting/stopping machines using a Provider, and connecting SSH channels to the actual TCP port onn the target machine.

Ownership of the Manager struct lies in the goroutine started in NewManager. Public methods on the Manager provide an interface to communicate with the goroutine. (This is essentially the agent pattern.)

func NewManager

func NewManager(provs providers.Providers) *Manager

NewManager creates a new Manager from the given Providers, and starts the main goroutine running the Manager message loop.

Ownership of the Providers passed in is transferred to the Manager. Specifically, Provider methods are called from the Manager goroutine.

func (*Manager) NewChannel

func (mgr *Manager) NewChannel(newChan ssh.NewChannel)

NewChannel transfers an SSH channel to the Manager for processing.

The Manager will verify the channel is 'direct-tcpip' channel and parse parameters, start the target machine if necessary, then connect the channel to the requested TCP port on the target machine.

func (*Manager) Stop

func (mgr *Manager) Stop()

Stop instructs the Manager to shutdown.

Once the Manager goroutine receives the stop message, it will shut down all machines and reject any further requests. The Stop method waits for all machines to shut down before returning.

Jump to

Keyboard shortcuts

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