Documentation ¶
Index ¶
- func GetLockShards() int
- type File
- type FileSystem
- func (fs *FileSystem) Close(f *File)
- func (fs *FileSystem) CreationLock(name string, hash uint16, wait bool) bool
- func (fs *FileSystem) CreationUnlock(name string, hash uint16)
- func (fs *FileSystem) GC(ttlSec int64, sleepBetweenDeletes time.Duration)
- func (fs *FileSystem) Open(name string, hash uint16) (f *File)
- func (h *FileSystem) Refresh(ttlSec int64, sleepBetweenDeletes time.Duration, ...)
- func (fs *FileSystem) Swap(name string, hash uint16, newid uint32, openNew bool) (f *File)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLockShards ¶
func GetLockShards() int
Types ¶
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func NewFileSystem ¶
func NewFileSystem(count int, gc func(id uint32, name string)) *FileSystem
func (*FileSystem) Close ¶
func (fs *FileSystem) Close(f *File)
func (*FileSystem) CreationLock ¶
func (fs *FileSystem) CreationLock(name string, hash uint16, wait bool) bool
CreationLock - if wait is true and the lock was already taken, then it waits for the other thread to finish creating but it doesn't retry to lock after that
func (*FileSystem) CreationUnlock ¶
func (fs *FileSystem) CreationUnlock(name string, hash uint16)
func (*FileSystem) GC ¶
func (fs *FileSystem) GC(ttlSec int64, sleepBetweenDeletes time.Duration)
GC must be called only once at a time
func (*FileSystem) Open ¶
func (fs *FileSystem) Open(name string, hash uint16) (f *File)
Open returns nil if the file does not exist
Click to show internal directories.
Click to hide internal directories.