Documentation
¶
Overview ¶
Package trzsz is the client side of trzsz (trzsz.github.io): when trz or tsz on the server prints its magic, Find spots it, Send gives trz the files it waits for and Receive takes those tsz sends. It speaks the protocol's first version, in base64, which every server takes, and draws nothing: the caller asks the user and shows how it goes.
Index ¶
- func Receive(ctx context.Context, c xfer.Conn, o *Offer, sink xfer.Sink, opt Options) (rest []byte, err error)
- func Refuse(ctx context.Context, c xfer.Conn, o *Offer) (rest []byte, err error)
- func Send(ctx context.Context, c xfer.Conn, o *Offer, src xfer.Source, opt Options) (rest []byte, err error)
- type Mode
- type Offer
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Receive ¶
func Receive(ctx context.Context, c xfer.Conn, o *Offer, sink xfer.Sink, opt Options) (rest []byte, err error)
Receive takes the files of a Download offer, and its folders, into sink. It returns what the shell printed after the transfer.
Types ¶
type Offer ¶
type Offer struct {
Mode Mode
// Version is the server's trzsz version.
Version string
// ID is the transfer's unique id; a terminal redrawn may show the
// magic again, with the same id.
ID string
// Windows is a server on Windows, whose console mangles lines.
Windows bool
// Tmux is a server inside tmux, which adds to what it prints.
Tmux bool
}
Offer is a transfer the server started, as its magic said.
type Options ¶
type Options struct {
// Progress is told how the files go; nil for nothing.
Progress xfer.Progress
// Saved is what the server prints once the files came: n of them,
// in dir. nil says it in English.
Saved func(n int, dir string) string
// Dir is where received files go, for Saved.
Dir string
}
Options are how a transfer goes.