Documentation
¶
Index ¶
Constants ¶
View Source
const MaxLoginChars = 32
Variables ¶
View Source
var ( CL = byte(0xD) RF = byte(0xA) NulChar = byte(0x0) CLRF = "\r\n" )
View Source
var ( DefaultShell = "/bin/sh" ShellArgs = app.FlagsArray{} )
View Source
var ( ErrServerStarted = errors.New("server is already started") ErrServerNotStarted = errors.New("server not started") )
Functions ¶
Types ¶
type AuthShellHandler ¶
type AuthShellHandler struct { IOParams // contains filtered or unexported fields }
AuthShellHandler is shell handler that requires username and password
func NewAuthShellHandler ¶
func NewAuthShellHandler(params IOParams, shell string, args ...string) AuthShellHandler
NewAuthShellHandler creates new authorized shell handler
func (AuthShellHandler) Handle ¶
func (h AuthShellHandler) Handle(ctx context.Context, rw io.ReadWriter) error
Handle implements telshell.Handler
type Handler ¶
type Handler interface {
Handle(ctx context.Context, rw io.ReadWriter) error
}
Handler is TCP request handler
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is telnet server used for serving requests
func NewServer ¶
NewServer creates new server with specified handlers.
Each handler executes one by one for each new connection
type ShellHandler ¶
type ShellHandler struct {
// contains filtered or unexported fields
}
ShellHandler provides shell access via Telnet
func NewShellHandler ¶
func NewShellHandler(params IOParams, shell string, args ...string) ShellHandler
NewShellHandler creates a new shell handler
func (ShellHandler) Handle ¶
func (s ShellHandler) Handle(ctx context.Context, rw io.ReadWriter) error
Handle implements telshell.Handler
type TerminalWrapper ¶
type TerminalWrapper struct { IOParams // contains filtered or unexported fields }
func NewTerminalWrapper ¶
func NewTerminalWrapper(log *zap.SugaredLogger, client io.ReadWriter, params IOParams) TerminalWrapper
type WelcomeHandler ¶
type WelcomeHandler struct{}
func (WelcomeHandler) Handle ¶
func (h WelcomeHandler) Handle(_ context.Context, rw io.ReadWriter) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.