Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveFrom ¶
ResolveFrom resolves p to an absolute path, relative to base.
func SortByDistance ¶
SortByDistance sorts paths according to their "distance" from base, according to Distance(base, path). Any two paths with the same distance from base are further sorted by their name.
Types ¶
type Distance ¶
type Distance uint32
Distance is a numerical distance between two paths
const ( // PreferBase is the zero distance. When passed to SortByDistance(), the // base path is sorted to the top. PreferBase Distance = 0 // PreferChildren is a distance midway between children of base paths, and // non-children. When passed to SortByDistance(), the base path is sorted // below its own children, but above non-children. PreferChildren Distance = math.MaxUint32 / 2 // PreferOther is the maximimum distance. When passed to SortByDistance(), // the base path is sorted to the bottom. PreferOther Distance = math.MaxUint32 )
func DistanceBetween ¶
DistanceBetween returns the "distance" from base to target. The more "hops"\ required to move from base to target, the larger the distance. Targets that are children of base are "closer" than targets that are not. If target is equal to base, the distance is baseDist.
Click to show internal directories.
Click to hide internal directories.