Documentation
¶
Overview ¶
Package zmodem 实现交互 SSH 使用的 ZMODEM 文件收发,不依赖外部命令。
Index ¶
- Variables
- func Cancel(out io.Writer) error
- func InitialHeader(data []byte) (upload bool, ok bool)
- func Receive(in io.ByteReader, out io.Writer, options ReceiveOptions) error
- func ReceiverWindow(data []byte) int
- func Send(in io.ByteReader, out io.Writer, file Upload, options SendOptions) (bool, error)
- type Download
- type ReceiveOptions
- type SendOptions
- type Upload
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCancelled = errors.New("transfer cancelled")
Functions ¶
func InitialHeader ¶
InitialHeader 只接受完整且 CRC 有效的标准起始帧;相似文本不吞掉。
func Receive ¶
func Receive(in io.ByteReader, out io.Writer, options ReceiveOptions) error
Receive 在调用方已消费 ZRQINIT 起始帧后接收一批文件。
func Send ¶
func Send(in io.ByteReader, out io.Writer, file Upload, options SendOptions) (bool, error)
Send 在调用方已消费 ZRINIT 起始帧后上传一个用户明确选择的普通文件。
Types ¶
type ReceiveOptions ¶
type SendOptions ¶
Click to show internal directories.
Click to hide internal directories.