package mem
Import Path
github.com/spf13/afero/mem (on go.dev )
Dependency Relation
imports 9 packages , and imported by one package
Package-Level Type Names (total 6, in which 5 are exported)
/* sort exporteds by: alphabet | popularity */
type File (struct)
Fields (total 5, none are exported )
/* 5 unexporteds ... */ /* 5 unexporteds: */
at int64
atomic requires 64-bit alignment for struct field access
closed bool
fileData *FileData
readDirCount int64
readOnly bool
Methods (total 16, all are exported )
(*T) Close () error
( T) Data () *FileData
(*T) Info () *FileInfo
(*T) Name () string
(*T) Open () error
(*T) Read (b []byte ) (n int , err error )
(*T) ReadAt (b []byte , off int64 ) (n int , err error )
(*T) Readdir (count int ) (res []os .FileInfo , err error )
(*T) Readdirnames (n int ) (names []string , err error )
(*T) Seek (offset int64 , whence int ) (int64 , error )
(*T) Stat () (os .FileInfo , error )
(*T) Sync () error
(*T) Truncate (size int64 ) error
(*T) Write (b []byte ) (n int , err error )
(*T) WriteAt (b []byte , off int64 ) (n int , err error )
(*T) WriteString (s string ) (ret int , err error )
Implements (at least 20, in which 19 are exported )
*T : github.com/spf13/afero.File
*T : io.Closer
*T : io.ReadCloser
*T : io.Reader
*T : io.ReaderAt
*T : io.ReadSeekCloser
*T : io.ReadSeeker
*T : io.ReadWriteCloser
*T : io.ReadWriter
*T : io.ReadWriteSeeker
*T : io.Seeker
*T : io.StringWriter
*T : io.WriteCloser
*T : io.Writer
*T : io.WriterAt
*T : io.WriteSeeker
*T : io/fs.File
*T : mime/multipart.File
*T : net/http.File
/* at least one unexported ... */ /* at least one unexported: */
*T : net/http.http2stringWriter
As Outputs Of (at least 2, both are exported )
func NewFileHandle (data *FileData ) *File
func NewReadOnlyFileHandle (data *FileData ) *File
type FileData (struct)
Fields (total 11, in which 1 are exported )
Mutex sync .Mutex
/* 10 unexporteds ... */ /* 10 unexporteds: */
data []byte
dir bool
gid int
memDir Dir
mode os .FileMode
modtime time .Time
Mutex .sema uint32
Mutex .state int32
name string
uid int
Methods (total 5, in which 3 are exported )
(*T) Lock ()
Lock locks m.
If the lock is already in use, the calling goroutine
blocks until the mutex is available.
(*T) Name () string
(*T) Unlock ()
Unlock unlocks m.
It is a run-time error if m is not locked on entry to Unlock.
A locked Mutex is not associated with a particular goroutine.
It is allowed for one goroutine to lock a Mutex and then
arrange for another goroutine to unlock it.
/* 2 unexporteds ... */ /* 2 unexporteds: */
(*T) lockSlow ()
(*T) unlockSlow (new int32 )
Implements (at least one exported )
*T : sync.Locker
As Outputs Of (at least 9, in which 5 are exported )
func CreateDir (name string ) *FileData
func CreateFile (name string ) *FileData
func Dir .Files () []*FileData
func DirMap .Files () (files []*FileData )
func File .Data () *FileData
/* 4+ unexporteds ... */ /* 4+ unexporteds: */
func github.com/spf13/afero.(*MemMapFs ).findParent (f *FileData ) *FileData
func github.com/spf13/afero.(*MemMapFs ).getData () map[string ]*FileData
func github.com/spf13/afero.(*MemMapFs ).lockfreeOpen (name string ) (*FileData , error )
func github.com/spf13/afero.(*MemMapFs ).open (name string ) (*FileData , error )
As Inputs Of (at least 20, in which 17 are exported )
func AddToMemDir (dir *FileData , f *FileData )
func AddToMemDir (dir *FileData , f *FileData )
func ChangeFileName (f *FileData , newname string )
func GetFileInfo (f *FileData ) *FileInfo
func InitializeDir (d *FileData )
func NewFileHandle (data *FileData ) *File
func NewReadOnlyFileHandle (data *FileData ) *File
func RemoveFromMemDir (dir *FileData , f *FileData )
func RemoveFromMemDir (dir *FileData , f *FileData )
func SetGID (f *FileData , gid int )
func SetMode (f *FileData , mode os .FileMode )
func SetModTime (f *FileData , mtime time .Time )
func SetUID (f *FileData , uid int )
func Dir .Add (*FileData )
func Dir .Remove (*FileData )
func DirMap .Add (f *FileData )
func DirMap .Remove (f *FileData )
/* 3+ unexporteds ... */ /* 3+ unexporteds: */
func setModTime (f *FileData , mtime time .Time )
func github.com/spf13/afero.(*MemMapFs ).findParent (f *FileData ) *FileData
func github.com/spf13/afero.(*MemMapFs ).registerWithParent (f *FileData , perm os .FileMode )
Package-Level Variables (total 6, all are exported)
Package-Level Constants (only one, which is exported)
The pages are generated with Golds v0.3.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .