fakefs

package
v2.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultFS

type DefaultFS struct{}

DefaultFS implements FileSystem using the local disk

func (DefaultFS) ReadFile

func (DefaultFS) ReadFile(name string) ([]byte, error)

func (DefaultFS) Stat

func (DefaultFS) Stat(name string) (os.FileInfo, error)

type FileInfo

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

FileInfo implements the os.FileInfo interface

func NewFileInfo

func NewFileInfo() *FileInfo

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (f *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (f *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() interface{}

type FileSystem

type FileSystem interface {
	Stat(name string) (os.FileInfo, error)
	ReadFile(name string) ([]byte, error)
}

type NotExistFS

type NotExistFS struct{}

NotExistFS will always return os.ErrNotExist type errors from calls to Stat

func (NotExistFS) ReadFile

func (NotExistFS) ReadFile(name string) ([]byte, error)

func (NotExistFS) Stat

func (NotExistFS) Stat(name string) (os.FileInfo, error)

type StringFS

type StringFS struct {
	File string
}

StringFS returns the string as the contents of the file

func (StringFS) ReadFile

func (fs StringFS) ReadFile(name string) ([]byte, error)

func (StringFS) Stat

func (fs StringFS) Stat(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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