fsdir

package
v0.0.0-...-03333d7 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned if a file is not found
	ErrNotFound = errors.New("file not found")
)

Functions

This section is empty.

Types

type File

type File struct {
	// contains filtered or unexported fields
}

File represents a file on the local system

func LoadFile

func LoadFile(prefix, path string, hasher hasher.Hasher) (*File, error)

LoadFile reads information and returns a File

func ReadDir

func ReadDir(prefix string, hasher hasher.Hasher) ([]*File, error)

ReadDir reads the contents of a directory on the system and returns []*File or error

func (*File) Hash

func (f *File) Hash() (string, error)

Hash returns the hash of a file

func (*File) ModTime

func (f *File) ModTime() (time.Time, error)

ModTime returns the mtime of a file

func (*File) Path

func (f *File) Path() string

Path returns the path (inside the working prefix) of the file

func (*File) SysPath

func (f *File) SysPath() string

SysPath returns the whole path to the file on the system

Jump to

Keyboard shortcuts

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