Documentation
¶
Overview ¶
Package fakeobj provides a fake object for testing. such as fake fs.File, fs.FileInfo, fs.DirEntry etc.
Index ¶
- type DirEntry
- type FileInfo
- func (f *FileInfo) Close() error
- func (f *FileInfo) IsDir() bool
- func (f *FileInfo) ModTime() time.Time
- func (f *FileInfo) Mode() fs.FileMode
- func (f *FileInfo) Name() string
- func (f *FileInfo) Read(p []byte) (int, error)
- func (f *FileInfo) Reset() *FileInfo
- func (f *FileInfo) Size() int64
- func (f *FileInfo) Stat() (fs.FileInfo, error)
- func (f *FileInfo) Sys() any
- func (f *FileInfo) WithBody(s string) *FileInfo
- func (f *FileInfo) WithMtime(mt time.Time) *FileInfo
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirEntry ¶
DirEntry implements the fs.DirEntry
func NewDirEntry ¶
NewDirEntry create a fs.DirEntry
type FileInfo ¶
type FileInfo struct {
Dir bool
Nam string // basename
Mod fs.FileMode
Mt time.Time
Contents string
CloseErr error
// contains filtered or unexported fields
}
FileInfo implements the fs.FileInfo, fs.File
type Writer ¶
type Writer struct {
bytes.Buffer
// ErrOnWrite return error on write, useful for testing
ErrOnWrite bool
// ErrOnFlush return error on flush, useful for testing
ErrOnFlush bool
// ErrOnClose return error on close, useful for testing
ErrOnClose bool
}
Writer implements the io.Writer, io.Flusher, io.Closer.
Click to show internal directories.
Click to hide internal directories.