Versions in this module Expand all Collapse all v1 v1.1.0 Dec 17, 2020 v1.0.0 May 7, 2020 Changes in this version + const BlockSize + const Blocks + const ExtentSize + const FALLOC_FL_KEEP_SIZE + const FALLOC_FL_NO_HIDE_STAE + const FALLOC_FL_PUNCH_HOLE + const FIEMAP_EXTENT_DATA_ENCRYPTED + const FIEMAP_EXTENT_DATA_INLINE + const FIEMAP_EXTENT_DATA_TAIL + const FIEMAP_EXTENT_DELALLOC + const FIEMAP_EXTENT_ENCODED + const FIEMAP_EXTENT_LAST + const FIEMAP_EXTENT_MERGED + const FIEMAP_EXTENT_NOT_ALIGNED + const FIEMAP_EXTENT_SHARED + const FIEMAP_EXTENT_UNKNOWN + const FIEMAP_EXTENT_UNWRITTEN + const FIEMAP_FLAGS_COMPAT + const FIEMAP_FLAG_CACHE + const FIEMAP_FLAG_SYNC + const FIEMAP_FLAG_XATTR + const FIEMAP_MAX_OFFSET + const FS_IOC_FIEMAP + const FiemapSize + var HTTPClientTimeout time.Duration = 30 + func AllocateAligned(size int) []byte + func FailPointFileHashMatch() bool + func FoldFile(childFileName, parentFileName string, ops FoldFileOperations) error + func HashData(data []byte) ([]byte, error) + func HashFileInterval(file FileIoProcessor, dataInterval Interval) ([]byte, error) + func ReadDataInterval(file FileIoProcessor, dataInterval Interval) ([]byte, error) + func SetFailPointFileHashMatch(fail bool) + func SyncFile(localPath string, remote string, timeout int) error + func WriteDataInterval(file FileIoProcessor, dataInterval Interval, data []byte) error + type BufferedFileIoProcessor struct + func NewBufferedFileIoProcessor(name string, flag int, perm os.FileMode, isCreate ...bool) (*BufferedFileIoProcessor, error) + func NewBufferedFileIoProcessorByFP(fp *os.File) *BufferedFileIoProcessor + func (file *BufferedFileIoProcessor) Close() error + func (file *BufferedFileIoProcessor) GetFile() *os.File + func (file *BufferedFileIoProcessor) Size() (int64, error) + type DirectFileIoProcessor struct + func NewDirectFileIoProcessor(name string, flag int, perm os.FileMode, isCreate ...bool) (*DirectFileIoProcessor, error) + func NewDirectFileIoProcessorByFP(fp *os.File) *DirectFileIoProcessor + func (file *DirectFileIoProcessor) GetFile() *os.File + func (file *DirectFileIoProcessor) ReadAt(data []byte, offset int64) (int, error) + func (file *DirectFileIoProcessor) Size() (int64, error) + func (file *DirectFileIoProcessor) WriteAt(data []byte, offset int64) (int, error) + type Extent struct + Flags uint32 + Length uint64 + Logical uint64 + Physical uint64 + Reserved [3]uint32 + Reserved64 [2]uint64 + func GetFiemapExtents(file FileIoProcessor) ([]Extent, error) + func GetFiemapRegionExts(file FileIoProcessor, interval Interval) ([]Extent, error) + type FiemapFile struct + func NewFiemapFile(f *os.File) FiemapFile + func (f FiemapFile) Fallocate(offset int64, length int64) error + func (f FiemapFile) Fiemap(size uint32) (uint32, []Extent, syscall.Errno) + func (f FiemapFile) FiemapRegion(numExts uint32, start uint64, length uint64) (uint32, []Extent, syscall.Errno) + func (f FiemapFile) PunchHole(offset int64, length int64) error + type FileInterval struct + Kind FileIntervalKind + func (i FileInterval) String() string + type FileIntervalKind int + const SparseData + const SparseHole + const SparseIgnore + type FileIoProcessor interface + Close func() error + GetFile func() *os.File + Name func() string + ReadAt func(data []byte, offset int64) (int, error) + Seek func(offset int64, whence int) (ret int64, err error) + Stat func() (os.FileInfo, error) + Sync func() error + Truncate func(size int64) error + WriteAt func(data []byte, offset int64) (int, error) + type FoldFileOperations interface + UpdateFoldFileProgress func(progress int, done bool, err error) + type Interval struct + Begin int64 + End int64 + func (interval Interval) Len() int64 + func (interval Interval) String() string