telnet

package
v1.0.54 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 13 Imported by: 2

Documentation

Overview

Package telnet implements telnet transport at very basic level.

Index

Constants

View Source
const (
	IAC  = "\xff"
	BIAC = 255

	SB  = "\xfa"
	BSB = 250
	SE  = "\xf0"
	BSE = 240

	WILL  = "\xfb"
	BWILL = 251
	WONT  = "\xfc"
	BWONT = 252
	DO    = "\xfd"
	BDO   = 253
	DONT  = "\xfe"
	BDONT = 254

	BINARY  = "\x00"
	BBINARY = 0
	ECHO    = "\x01"
	BECHO   = 1
	SGA     = "\x03"
	BSGA    = 03
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Streamer

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

func NewStreamer

func NewStreamer(host string, credentials credentials.Credentials, opts ...StreamerOption) *Streamer

func (*Streamer) Close

func (m *Streamer) Close()

func (*Streamer) Cmd

func (*Streamer) Download

func (m *Streamer) Download(paths []string, recurse bool) (map[string]streamer.File, error)

func (*Streamer) GetCredentials

func (m *Streamer) GetCredentials() credentials.Credentials

func (Streamer) HasFeature

func (m Streamer) HasFeature(feature streamer.Const) bool

func (*Streamer) Init

func (m *Streamer) Init(ctx context.Context) error

func (*Streamer) InitAgentForward

func (m *Streamer) InitAgentForward() error

func (*Streamer) Read

func (m *Streamer) Read(context.Context, int) ([]byte, error)

func (*Streamer) ReadTo

func (m *Streamer) ReadTo(ctx context.Context, expr expr.Expr) (streamer.ReadRes, error)

func (*Streamer) SetCredentialsInterceptor

func (m *Streamer) SetCredentialsInterceptor(inter func(credentials.Credentials) credentials.Credentials)

func (*Streamer) SetReadTimeout

func (m *Streamer) SetReadTimeout(duration time.Duration) time.Duration

func (*Streamer) SetTrace

func (m *Streamer) SetTrace(cb trace.CB)

func (*Streamer) Upload

func (m *Streamer) Upload(m2 map[string]streamer.File) error

func (*Streamer) Write

func (m *Streamer) Write(text []byte) error

type StreamerOption

type StreamerOption func(*Streamer)

func WithLogger

func WithLogger(log *zap.Logger) StreamerOption

func WithTrace

func WithTrace(trace trace.CB) StreamerOption

Jump to

Keyboard shortcuts

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