telnet

package
v1.0.92 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 13 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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