fs

package
v0.17.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lstat

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

Lstat see syscall.Lstat

func Mock

func Mock(mock Interface)

Mock is used to switch out the filesystem for a mock.

func Open

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

Open see os.Open

func ReadDir

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

ReadDir see ioutil.ReadDir

func ReadDirNames

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

ReadDirNames see os.File.ReadDirNames

func ReadFile

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

ReadFile see ioutil.ReadFile

func Restore

func Restore()

Restore puts back the real filesystem.

func Stat

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

Stat see syscall.Stat

Types

type Interface

type Interface interface {
	ReadDir(string) ([]os.FileInfo, error)
	ReadDirNames(string) ([]string, error)
	ReadFile(string) ([]byte, error)
	Lstat(string, *syscall.Stat_t) error
	Stat(string, *syscall.Stat_t) error
	Open(string) (io.ReadWriteCloser, error)
}

Interface is the filesystem interface type.

Jump to

Keyboard shortcuts

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