fs

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry interface {
	os.FileInfo
	fs.Interface
	Add(path string, e Entry) error
	Remove(path string) error
}

Entry is an entry in the mock filesystem

func Dir

func Dir(name string, entries ...Entry) Entry

Dir creates a new directory with the given entries.

type File

type File struct {
	FName     string
	FContents string
	FReader   io.Reader
	FWriter   io.Writer
	FCloser   io.Closer
	FStat     syscall.Stat_t
	// contains filtered or unexported fields
}

File is a mock file

func (File) Add added in v0.14.0

func (p File) Add(path string, e Entry) error

Add adds a new node to the fs

func (File) IsDir

func (p File) IsDir() bool

IsDir implements os.FileInfo

func (File) Lstat

func (p File) Lstat(path string, stat *syscall.Stat_t) error

Lstat implements FS

func (File) ModTime

func (File) ModTime() time.Time

func (File) Mode

func (File) Mode() os.FileMode

func (File) Name

func (p File) Name() string

Name implements os.FileInfo

func (File) Open

func (p File) Open(path string) (io.ReadWriteCloser, error)

Open implements FS

func (File) ReadDir

func (p File) ReadDir(path string) ([]os.FileInfo, error)

ReadDir implements FS

func (File) ReadDirNames

func (p File) ReadDirNames(path string) ([]string, error)

ReadDirNames implements FS

func (File) ReadFile

func (p File) ReadFile(path string) ([]byte, error)

ReadFile implements FS

func (File) Remove added in v0.14.0

func (p File) Remove(path string) error

Remove removes a node from the fs

func (File) Size

func (File) Size() int64

func (File) Stat

func (p File) Stat(path string, stat *syscall.Stat_t) error

Stat implements FS

func (File) Sys

func (File) Sys() interface{}

Jump to

Keyboard shortcuts

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