Documentation
¶
Overview ¶
Package workdirs reads the directories workflow can be pointed at: what is in one, whether it is there, and how a typed path or a directory is written. It lists names and asks whether a name is a directory; it never reads a file.
Index ¶
Constants ¶
const ListLimit = 1000
ListLimit bounds how many directories a listing holds, so a directory of thousands answers with what fits on a screen and says there was more.
Variables ¶
var ( // ErrNotFound is a directory that is not there. ErrNotFound = errors.New("there is no such directory") // ErrNotADirectory is a path that names something other than a directory. ErrNotADirectory = errors.New("that is not a directory") // ErrNotAbsolute is a path not written from the root. ErrNotAbsolute = errors.New("the path is not absolute") // ErrUnreadable is a directory that is there but cannot be listed. ErrUnreadable = errors.New("the directory cannot be read") )
Functions ¶
func Resolve ¶
Resolve is the directory typed names: from the root as written, from your home after a ~, and from base otherwise; blank, it is base. A ~ is followed by either separator, so ~/src reads the same on Windows.
Types ¶
type Listing ¶
Listing is the directories in one, by name, and whether there were more than ListLimit.
type Match ¶ added in v0.11.0
type Match struct {
Entry Entry
// Letters is the place of each matched letter among the name's letters,
// counted from zero.
Letters []int
Prefix bool
}
Match is an entry whose name holds what was typed, letter by letter in order: where in the name each letter matched, and whether the name starts with them.