backend

package module
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 13 Imported by: 1

README

ContainerSSH - Launch Containers on Demand

ContainerSSH Backend Library

Go Report Card LGTM Alerts

This library handles SSH requests and routes them to a container or other backends.

Note: This is a developer documentation.
The user documentation for ContainerSSH is located at containerssh.github.io.

Using this library

This library can be used in conjunction with the sshserver to route SSH connections to containers.

You can create a new backend handler like this:

handler, err := backend.New(
    config,
    logger,
    loggerFactory,
    authBehavior,
)

This method accepts the following parameters:

config : The AppConfig struct from the configuration library. This is needed because this library performs a call to the config server if configured to fetch a connection-specific information.

logger : This variable is a logger from the log library.

loggerFactory : This is a logger factory used by the backend to create a logger for the instantiated backends after fetching the connection-specific configuration.

authBehavior : This variable can contain one of sshserver.AuthResponseSuccess, sshserver.AuthResponseFailure, or sshserver.AuthResponseUnavailable to indicate how the backend should react to authenticatio requests. Normally, this can be set to sshserver.AuthResponseUnavailable since the auth integration library will take care of the authentication.

The handler can be passed to the sshserver or to another overlay as a backend, for example auth integration.

Documentation

Index

Constants

View Source
const MetricHelpBackendError = "The number of failed requests to the backend."

MetricHelpBackendError is the help text of backend errors

View Source
const MetricHelpBackendRequests = "The number of requests to the backend."

MetricHelpBackendError is the help text of backend errors

View Source
const MetricLabelBackend = "backend"

MetricLabelBackend is the name for the backend label

View Source
const MetricNameBackendError = "containerssh_backend_errors"

MetricNameBackendError is the number of errors in the backend

View Source
const MetricNameBackendRequests = "containerssh_backend_requests"

MetricNameBackendError is the number of errors in the backend

View Source
const MetricUnitBackendError = "requests"

MetricUnitBackendError is the unit of backend errors

View Source
const MetricUnitBackendRequests = "requests"

MetricUnitBackendError is the unit of backend errors

Variables

This section is empty.

Functions

func New

func New(
	config configuration.AppConfig,
	logger log.Logger,
	loggerFactory log.LoggerFactory,
	metricsCollector metrics.Collector,
	defaultAuthResponse sshserver.AuthResponse,
) (sshserver.Handler, error)

New creates a new backend handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

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