Documentation ¶
Index ¶
- Constants
- Variables
- func CheckDiskIsFast() (speedMB float64, isFast bool, err error)
- func CheckDiskWritingSpeed() (speedMB float64, err error)
- func DiskIsExtremelyFast() bool
- func DiskIsFast() bool
- func Open(name string) (f *os.File, err error)
- func OpenFile(name string, flag int, perm os.FileMode) (f *os.File, err error)
- func ReadFile(filename string) (data []byte, err error)
- func Remove(filename string) (err error)
- func Rename(oldPath string, newPath string) (err error)
- func WaitLoad(maxLoad float64, maxLoops int, delay time.Duration)
- func WriteFile(filename string, data []byte, perm os.FileMode) (err error)
- type DiskSpeedCache
- type File
- func (this *File) Close() (err error)
- func (this *File) Fd() uintptr
- func (this *File) Name() string
- func (this *File) Raw() *os.File
- func (this *File) Read(b []byte) (n int, err error)
- func (this *File) ReadAt(b []byte, off int64) (n int, err error)
- func (this *File) Seek(offset int64, whence int) (ret int64, err error)
- func (this *File) Stat() (os.FileInfo, error)
- func (this *File) Sync() (err error)
- func (this *File) Truncate(size int64) (err error)
- func (this *File) Write(b []byte) (n int, err error)
- func (this *File) WriteAt(b []byte, off int64) (n int, err error)
- type Limiter
- type Locker
- type Speed
- type StatResult
Constants ¶
View Source
const FlagRead = 0x1
View Source
const FlagWrite = 0x2
Variables ¶
View Source
var ( DiskSpeed = SpeedLow DiskSpeedMB float64 )
View Source
var IsInExtremelyHighLoad = false
View Source
var IsInHighLoad = false
View Source
var ReaderLimiter = NewLimiter(max(maxThreads, 8))
View Source
var WriterLimiter = NewLimiter(max(maxThreads, 8))
Functions ¶
func CheckDiskIsFast ¶ added in v1.2.5
CheckDiskIsFast check disk is 'fast' disk to write
func CheckDiskWritingSpeed ¶ added in v1.2.5
CheckDiskWritingSpeed test disk writing speed
func DiskIsExtremelyFast ¶ added in v1.2.7
func DiskIsExtremelyFast() bool
func DiskIsFast ¶ added in v1.2.7
func DiskIsFast() bool
Types ¶
type DiskSpeedCache ¶ added in v1.2.10
type File ¶ added in v1.3.8
type File struct {
// contains filtered or unexported fields
}
type Limiter ¶ added in v1.3.7
type Limiter struct {
// contains filtered or unexported fields
}
func NewLimiter ¶ added in v1.3.7
func (*Limiter) FreeThreads ¶ added in v1.3.7
func (*Limiter) SetThreads ¶ added in v1.3.8
type StatResult ¶
type StatResult struct {
// contains filtered or unexported fields
}
func NewStatResult ¶
func NewStatResult(rawStat *unix.Statfs_t) *StatResult
func StatDevice ¶ added in v1.2.9
func StatDevice(path string) (*StatResult, error)
StatDevice device contains the path
func StatDeviceCache ¶ added in v1.2.9
func StatDeviceCache(path string) (*StatResult, error)
StatDeviceCache stat device with cache
func (*StatResult) FreeSize ¶
func (this *StatResult) FreeSize() uint64
func (*StatResult) TotalSize ¶
func (this *StatResult) TotalSize() uint64
func (*StatResult) UsedSize ¶
func (this *StatResult) UsedSize() uint64
Click to show internal directories.
Click to hide internal directories.