package fs
import "github.com/evanw/esbuild/internal/fs"
Index ¶
- func AfterFileClose()
- func BeforeFileOpen()
- func CheckIfWindows() bool
- type DifferentCase
- type DirEntries
- func MakeEmptyDirEntries(dir string) DirEntries
- func (entries DirEntries) Get(query string) (*Entry, *DifferentCase)
- func (entries DirEntries) Len() int
- func (entries DirEntries) UnorderedKeys() (keys []string)
- type Entry
- type EntryKind
- type FS
- type ModKey
- type RealFSOptions
- type WatchData
Functions ¶
func AfterFileClose ¶
func AfterFileClose()
func BeforeFileOpen ¶
func BeforeFileOpen()
func CheckIfWindows ¶
func CheckIfWindows() bool
Types ¶
type DifferentCase ¶
type DirEntries ¶
type DirEntries struct {
// contains filtered or unexported fields
}
func MakeEmptyDirEntries ¶
func MakeEmptyDirEntries(dir string) DirEntries
func (DirEntries) Get ¶
func (entries DirEntries) Get(query string) (*Entry, *DifferentCase)
func (DirEntries) Len ¶
func (entries DirEntries) Len() int
func (DirEntries) UnorderedKeys ¶
func (entries DirEntries) UnorderedKeys() (keys []string)
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
func (*Entry) Kind ¶
func (*Entry) Symlink ¶
type EntryKind ¶
type EntryKind uint8
type FS ¶
type FS interface { // The returned map is immutable and is cached across invocations. Do not // mutate it. ReadDirectory(path string) (entries DirEntries, canonicalError error, originalError error) ReadFile(path string) (contents string, canonicalError error, originalError error) // This is a key made from the information returned by "stat". It is intended // to be different if the file has been edited, and to otherwise be equal if // the file has not been edited. It should usually work, but no guarantees. // // See https://apenwarr.ca/log/20181113 for more information about why this // can be broken. For example, writing to a file with mmap on WSL on Windows // won't change this key. Hopefully this isn't too much of an issue. // // Additional reading: // - https://github.com/npm/npm/pull/20027 // - https://github.com/golang/go/commit/7dea509703eb5ad66a35628b12a678110fbb1f72 ModKey(path string) (ModKey, error) // This is part of the interface because the mock interface used for tests // should not depend on file system behavior (i.e. different slashes for // Windows) while the real interface should. IsAbs(path string) bool Abs(path string) (string, bool) Dir(path string) string Base(path string) string Ext(path string) string Join(parts ...string) string Cwd() string Rel(base string, target string) (string, bool) // This is a set of all files used and all directories checked. The build // must be invalidated if any of these watched files change. WatchData() WatchData // contains filtered or unexported methods }
func MockFS ¶
func RealFS ¶
func RealFS(options RealFSOptions) (FS, error)
type ModKey ¶
type ModKey struct {
// contains filtered or unexported fields
}
type RealFSOptions ¶
type WatchData ¶
type WatchData struct { // These functions return true if the file system entry has been modified Paths map[string]func() bool }
Source Files ¶
filepath.go fs.go fs_mock.go fs_real.go iswin_windows.go modkey_other.go
- Version
- v0.11.8
- Published
- Apr 11, 2021
- Platform
- windows/amd64
- Imports
- 10 packages
- Last checked
- 46 minutes ago –
Tools for package owners.