trzsz

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAffectedByWindows

func SetAffectedByWindows(affected bool)

SetAffectedByWindows set whether trzsz is affected by Windows.

func TrzMain

func TrzMain() int

TrzMain is the main function of `trz` binary.

func TrzszMain

func TrzszMain() int

TrzszMain is the main function of `trzsz` binary.

func TszMain

func TszMain() int

TszMain is the main function of `tsz` binary.

Types

type TrzszFilter

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

TrzszFilter is a filter that supports trzsz ( trz / tsz ).

func NewTrzszFilter

func NewTrzszFilter(clientIn io.Reader, clientOut io.WriteCloser,
	serverIn io.WriteCloser, serverOut io.Reader, options TrzszOptions) *TrzszFilter

NewTrzszFilter create a TrzszFilter to support trzsz ( trz / tsz ).

┌────────┐ ClientIn ┌─────────────┐ ServerIn ┌────────┐ │ ├─────────────►│ ├─────────────►│ │ │ Client │ │ TrzszFilter │ │ Server │ │ │◄─────────────┤ │◄─────────────┤ │ └────────┘ ClientOut └─────────────┘ ServerOut └────────┘

Specify the columns of the terminal in options.TerminalColumns.

func (*TrzszFilter) IsTransferringFiles

func (filter *TrzszFilter) IsTransferringFiles() bool

IsTransferringFiles returns whether trzsz is transferring files.

func (*TrzszFilter) SetDefaultDownloadPath

func (filter *TrzszFilter) SetDefaultDownloadPath(path string)

SetDefaultDownloadPath set the path to automatically save while downloading files.

func (*TrzszFilter) SetDefaultUploadPath

func (filter *TrzszFilter) SetDefaultUploadPath(path string)

SetDefaultUploadPath set the default open path while choosing upload files.

func (*TrzszFilter) SetDragFileUploadCommand

func (filter *TrzszFilter) SetDragFileUploadCommand(command string)

SetDragFileUploadCommand set the command to execute while dragging files to upload.

func (*TrzszFilter) SetProgressColorPair

func (filter *TrzszFilter) SetProgressColorPair(colorPair string)

SetProgressColorPair set the color pair for the progress bar.

func (*TrzszFilter) SetTerminalColumns

func (filter *TrzszFilter) SetTerminalColumns(columns int32)

SetTerminalColumns set the latest columns of the terminal.

func (*TrzszFilter) SetTunnelConnector

func (filter *TrzszFilter) SetTunnelConnector(connector func(int) net.Conn)

SetTunnelConnector set the connector for tunnel transferring.

func (*TrzszFilter) StopTransferringFiles

func (filter *TrzszFilter) StopTransferringFiles(stopAndDelete bool)

StopTransferringFiles tell trzsz to stop if it is transferring files.

func (*TrzszFilter) UploadFiles

func (filter *TrzszFilter) UploadFiles(filePaths []string) error

UploadFiles try to upload the files and directories asynchronously.

Returns nil means added to the upload queue, not mean that the upload is successful. Returns error if an error occurs before adding to the upload queue.

type TrzszOptions

type TrzszOptions struct {
	// TerminalColumns is the columns of the terminal.
	TerminalColumns int32
	// DetectDragFile is an optional feature.
	// If DetectDragFile is true, will detect the user input to determine whether user is dragging to upload.
	DetectDragFile bool
	// DetectTraceLog is for debugging.
	// If DetectTraceLog is true, will detect the server output to determine whether to enable trace logging.
	DetectTraceLog bool
	// EnableZmodem enable zmodem lrzsz ( rz / sz ) feature.
	EnableZmodem bool
	// EnableOSC52 enable OSC52 clipboard feature.
	EnableOSC52 bool
}

TrzszOptions specify the options to create a TrzszFilter.

type TrzszRelay

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

TrzszRelay is a relay that supports trzsz ( trz / tsz ).

func NewTrzszRelay

func NewTrzszRelay(clientIn io.Reader, clientOut io.WriteCloser,
	serverIn io.WriteCloser, serverOut io.Reader, options TrzszOptions) *TrzszRelay

NewTrzszRelay create a TrzszRelay to support trzsz through a jump server.

┌────────┐ ClientIn ┌────────────┐ ServerIn ┌────────┐ │ ├─────────────►│ ├─────────────►│ │ │ Client │ │ TrzszRelay │ │ Server │ │ │◄─────────────┤ │◄─────────────┤ │ └────────┘ ClientOut └────────────┘ ServerOut └────────┘

func (*TrzszRelay) SetTunnelConnector

func (r *TrzszRelay) SetTunnelConnector(connector func(int) net.Conn)

SetTunnelConnector set the connector for tunnel transferring.

Jump to

Keyboard shortcuts

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