Documentation
¶
Overview ¶
Package send implements the sending side: collecting local paths and pushing them to a peer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
// Path is the local file to read.
Path string
// Name is the fileName sent over the wire. For a directory it carries the
// relative path below the directory, always with "/" separators.
Name string
Size int64
Modified time.Time
}
Entry is one file to transfer.
func Collect ¶
Collect expands the given paths into the files to send.
Files are taken by their base name; directories are walked recursively and contribute "<dir>/<relative path>" names, which is how LocalSend transfers a folder — the protocol has no folder concept of its own.
Symlinks below a directory are skipped: following them risks cycles and sending data from outside the selected tree.
type Options ¶
type Options struct {
Identity *identity.Identity
Target proto.Device
Entries []Entry
// PIN is appended to prepare-upload when the receiver asks for one.
PIN string
// Parallel is the number of concurrent uploads. Values below 2 upload one
// file after another, which keeps the progress display readable.
Parallel int
// Port is announced to the receiver so it can send something back. The
// default port is right whenever a daemon runs on this host, which is the
// common setup.
Port int
}
Options configures a transfer.
Click to show internal directories.
Click to hide internal directories.