path

package
v0.0.1-beta7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package path is used to represent path info objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Header() string

Header returns a comma separated list of the expected columns that will be outputted by Info.String().

func HeaderWithHash

func HeaderWithHash() string

Header returns a comma separated list of the expected columns that will be outputted for paths with a file signature hash.

Types

type Id

type Id file.PathHash

Unique identifier of a path. It is simply the SHA1 hash of the path.

func IdFromPath

func IdFromPath(path string) Id

Create a path identifier.

type Info

type Info struct {
	Id   Id     // The unique identifier
	Path string // The file system path

	Size    uint64      // Size in bytes, if it is a file
	Mode    fs.FileMode // Type and permission bits
	ModTime time.Time   // Last modification time
}

Describe a found path while scanning.

func InfoFromWalk

func InfoFromWalk(path string, entry fs.DirEntry) (Info, error)

Create the path info from the results of a file system walk [filepath.WalkDir] or file.Walker.

func (*Info) Equals

func (p *Info) Equals(o *Info) bool

Return true if this path info is equal to another.

func (*Info) IsDir

func (p *Info) IsDir() bool

Return true if the path is a directory.

func (*Info) IsFile

func (p *Info) IsFile() bool

Return true if the path is a regular file.

func (Info) String

func (p Info) String() string

Stringer implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL