Documentation
¶
Overview ¶
Package xfertest has what tests of transfers over a terminal use: both ends of a byte stream, and files kept in memory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type End ¶
type End struct {
// Tamper, when set, changes what this end writes on its way.
Tamper func(p []byte) []byte
// Wrote is all this end wrote, as it went out.
Wrote bytes.Buffer
// contains filtered or unexported fields
}
End is one end of a Pipe.
func Pipe ¶
func Pipe() (a, b *End)
Pipe returns both ends of a stream: what one writes, the other reads.
type Sink ¶
type Sink struct {
// Files are those committed, by name.
Files map[string][]byte
// Dirs are the folders made.
Dirs []string
// Info is what was said of each file created.
Info []xfer.File
// Aborted counts the files dropped.
Aborted int
// Skip names files to skip; Fail fails Create for every file.
Skip map[string]bool
Fail error
// Rename gives the local name of a file, when set.
Rename func(name string) string
// contains filtered or unexported fields
}
Sink keeps received files in memory.