package mem
import "github.com/spf13/afero/mem"
Index ¶
- Constants
- Variables
- func AddToMemDir(dir *FileData, f *FileData)
- func ChangeFileName(f *FileData, newname string)
- func InitializeDir(d *FileData)
- func RemoveFromMemDir(dir *FileData, f *FileData)
- func SetGID(f *FileData, gid int)
- func SetModTime(f *FileData, mtime time.Time)
- func SetMode(f *FileData, mode os.FileMode)
- func SetUID(f *FileData, uid int)
- type Dir
- type DirMap
- func (m DirMap) Add(f *FileData)
- func (m DirMap) Files() (files []*FileData)
- func (m DirMap) Len() int
- func (m DirMap) Names() (names []string)
- func (m DirMap) Remove(f *FileData)
- type File
- func NewFileHandle(data *FileData) *File
- func NewReadOnlyFileHandle(data *FileData) *File
- func (f *File) Close() error
- func (f File) Data() *FileData
- func (f *File) Info() *FileInfo
- func (f *File) Name() string
- func (f *File) Open() error
- func (f *File) Read(b []byte) (n int, err error)
- func (f *File) ReadAt(b []byte, off int64) (n int, err error)
- func (f *File) ReadDir(n int) ([]fs.DirEntry, error)
- func (f *File) Readdir(count int) (res []os.FileInfo, err error)
- func (f *File) Readdirnames(n int) (names []string, err error)
- func (f *File) Seek(offset int64, whence int) (int64, error)
- func (f *File) Stat() (os.FileInfo, error)
- func (f *File) Sync() error
- func (f *File) Truncate(size int64) error
- func (f *File) Write(b []byte) (n int, err error)
- func (f *File) WriteAt(b []byte, off int64) (n int, err error)
- func (f *File) WriteString(s string) (ret int, err error)
- type FileData
- func CreateDir(name string) *FileData
- func CreateFile(name string) *FileData
- func (d *FileData) Name() string
- type FileInfo
Constants ¶
Variables ¶
var ( ErrFileClosed = errors.New("File is closed") ErrOutOfRange = errors.New("out of range") ErrTooLarge = errors.New("too large") ErrFileNotFound = os.ErrNotExist ErrFileExists = os.ErrExist ErrDestinationExists = os.ErrExist )
Functions ¶
func AddToMemDir ¶
func ChangeFileName ¶
func InitializeDir ¶
func InitializeDir(d *FileData)
func RemoveFromMemDir ¶
func SetGID ¶
func SetModTime ¶
func SetMode ¶
func SetUID ¶
Types ¶
type Dir ¶
type Dir interface { Len() int Names() []string Files() []*FileData Add(*FileData) Remove(*FileData) }
type DirMap ¶
func (DirMap) Add ¶
func (DirMap) Files ¶
func (DirMap) Len ¶
func (DirMap) Names ¶
func (DirMap) Remove ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func NewFileHandle ¶
func NewReadOnlyFileHandle ¶
func (*File) Close ¶
func (File) Data ¶
func (*File) Info ¶
func (*File) Name ¶
func (*File) Open ¶
func (*File) Read ¶
func (*File) ReadAt ¶
func (*File) ReadDir ¶
Implements fs.ReadDirFile
func (*File) Readdir ¶
func (*File) Readdirnames ¶
func (*File) Seek ¶
func (*File) Stat ¶
func (*File) Sync ¶
func (*File) Truncate ¶
func (*File) Write ¶
func (*File) WriteAt ¶
func (*File) WriteString ¶
type FileData ¶
func CreateDir ¶
func CreateFile ¶
func (*FileData) Name ¶
type FileInfo ¶
type FileInfo struct { *FileData }
func GetFileInfo ¶
func (*FileInfo) IsDir ¶
func (*FileInfo) ModTime ¶
func (*FileInfo) Mode ¶
func (*FileInfo) Name ¶
Implements os.FileInfo
func (*FileInfo) Size ¶
func (*FileInfo) Sys ¶
func (s *FileInfo) Sys() interface{}
Source Files ¶
- Version
- v1.12.0 (latest)
- Published
- Jan 9, 2025
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 2 days ago –
Tools for package owners.