testdir

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tree

func Tree(dir string) (string, error)

Types

type Dir

type Dir struct {
	Backup      bool
	Skip        func(name string, isDir bool) (skip bool)
	Files       map[string]string          // String files (convenient)
	BFiles      map[string][]byte          // Byte files (for images and binaries)
	MapFiles    map[string]*fstest.MapFile // Map files (for directories)
	Modules     map[string]string          // name[version]
	NodeModules map[string]string          // name[version]
	// contains filtered or unexported fields
}

func New

func New(dir string) *Dir

func (*Dir) Exists added in v0.1.5

func (d *Dir) Exists(paths ...string) error

Exists returns nil if path exists. Should be called after Write.

func (*Dir) Hash

func (d *Dir) Hash() (string, error)

Hash returns a file hash of our mapped file system

func (*Dir) NotExists added in v0.1.5

func (d *Dir) NotExists(paths ...string) error

NotExists returns nil if path doesn't exist. Should be called after Write.

func (*Dir) Path added in v0.1.5

func (d *Dir) Path(subpaths ...string) string

Dir returns the directory

func (*Dir) Stat added in v0.1.5

func (d *Dir) Stat(path string) (fs.FileInfo, error)

Stat return the file info of path. Should be called after Write.

func (*Dir) Write

func (d *Dir) Write(ctx context.Context) error

Write testdir into dir

Jump to

Keyboard shortcuts

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