handlers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlHandler

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

ControlHandler is used for control functions and health monitoring.

func NewControlHandler

func NewControlHandler(user *user.User) *ControlHandler

NewControlHandler returns a new control handler.

func (*ControlHandler) Close

func (h *ControlHandler) Close()

Close the control handler.

func (*ControlHandler) Read

func (h *ControlHandler) Read(p []byte) (n int, err error)

Read is to send data to the client via the Reader interface.

func (*ControlHandler) Wait

func (h *ControlHandler) Wait() <-chan struct{}

Wait returns the handler stop channel.

func (*ControlHandler) Write

func (h *ControlHandler) Write(p []byte) (n int, err error)

Write is to read data to the client via the Writer interface.

type Handler

type Handler interface {
	io.ReadWriter
	Close()
	Wait() <-chan struct{}
}

Handler interface for server side functionality.

type ServerHandler

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

ServerHandler implements the Reader and Writer interfaces to handle the Bi-directional communication between SSH client and server. This handler implements the handler of the SSH server.

func NewServerHandler

func NewServerHandler(user *user.User, catLimiter chan struct{}, tailLimiter chan struct{}) *ServerHandler

NewServerHandler returns the server handler.

func (*ServerHandler) Close

func (h *ServerHandler) Close()

Close the server handler.

func (*ServerHandler) Read

func (h *ServerHandler) Read(p []byte) (n int, err error)

Read is to send data to the dtail client via Reader interface.

func (*ServerHandler) Wait

func (h *ServerHandler) Wait() <-chan struct{}

Wait (block) until server handler is closed or a timeout has exceeded.

func (*ServerHandler) Write

func (h *ServerHandler) Write(p []byte) (n int, err error)

Write is to receive data from the dtail client via Writer interface.

Jump to

Keyboard shortcuts

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