Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsurePath ¶
EnsurePath ensures a directory exists, given a file path. This calls path.Dir(p)
func FileSize ¶
FileSize returns the file size in bytes, or return 0 if there's an error calling os.Stat().
func Reader ¶
Reader wraps an io.Reader with one that checks ctx.Done() on each Read call.
If ctx has a deadline and if r has a `SetReadDeadline(time.Time) error` method, then it is called with the deadline.
Imported from https://gist.github.com/dchapes/6c992bf3e943934462509338cd213e99
func Writer ¶
Writer wraps an io.Writer with one that checks ctx.Done() on each Write call.
If ctx has a deadline and if w has a `SetWriteDeadline(time.Time) error` method, then it is called with the deadline.
Imported from https://gist.github.com/dchapes/6c992bf3e943934462509338cd213e99
Types ¶
type Hostfile ¶
type Hostfile struct { // The path relative to the "root" given to WalkFiles(). Rel string // The absolute path of the file on the host. Abs string // Size in bytes. Size int64 // LastModified time LastModified time.Time }
Hostfile returns information about a file found by WalkFiles.