Versions in this module Expand all Collapse all v1 v1.2.0 Oct 30, 2024 v1.1.0 Jun 24, 2024 Changes in this version + const InvalidFd + var ErrUnsupported = errors.New("pebble: not supported") + func Clone(srcFS, dstFS FS, srcPath, dstPath string, opts ...CloneOption) (bool, error) + func Copy(fs FS, oldname, newname string) error + func CopyAcrossFS(srcFS FS, oldname string, dstFS FS, newname string) error + func IsNoSpaceError(err error) bool — darwin/amd64, linux/amd64, windows/amd64 + func LimitedCopy(fs FS, oldname, newname string, maxBytes int64) error + func LinkOrCopy(fs FS, oldname, newname string) error + type CloneOption func(*cloneOpts) + var CloneSync CloneOption = func(o *cloneOpts) { ... } + var CloneTryLink CloneOption = func(o *cloneOpts) { ... } + func CloneSkip(fn func(string) bool) CloneOption + type DiskSlowInfo struct + Duration time.Duration + OpType OpType + Path string + WriteSize int + func (i DiskSlowInfo) SafeFormat(w redact.SafePrinter, _ rune) + func (i DiskSlowInfo) String() string + type DiskUsage struct + AvailBytes uint64 + TotalBytes uint64 + UsedBytes uint64 + type FS interface + Create func(name string) (File, error) + GetDiskUsage func(path string) (DiskUsage, error) + Link func(oldname, newname string) error + List func(dir string) ([]string, error) + Lock func(name string) (io.Closer, error) + MkdirAll func(dir string, perm os.FileMode) error + Open func(name string, opts ...OpenOption) (File, error) + OpenDir func(name string) (File, error) + OpenReadWrite func(name string, opts ...OpenOption) (File, error) + PathBase func(path string) string + PathDir func(path string) string + PathJoin func(elem ...string) string + Remove func(name string) error + RemoveAll func(name string) error + Rename func(oldname, newname string) error + ReuseForWrite func(oldname, newname string) (File, error) + Stat func(name string) (os.FileInfo, error) + var Default FS = defaultFS{} + func NewSyncingFS(fs FS, syncOpts SyncingFileOptions) FS + func OnDiskFull(fs FS, fn func()) FS + func Root(fs FS) FS + func WithDiskHealthChecks(innerFS FS, diskSlowThreshold time.Duration, ...) (FS, io.Closer) + func WithLogging(fs FS, logFn LogFn) FS + type File interface + Fd func() uintptr + Preallocate func(offset, length int64) error + Prefetch func(offset int64, length int64) error + Stat func() (os.FileInfo, error) + Sync func() error + SyncData func() error + SyncTo func(length int64) (fullSync bool, err error) + WriteApproved func(p []byte) (n int, err error) + func NewMemFile(data []byte) File + func NewSyncingFile(f File, opts SyncingFileOptions) File + type LogFn func(fmt string, args ...interface{}) + type MemFS struct + func NewMem() *MemFS + func NewStrictMem() *MemFS + func (*MemFS) GetDiskUsage(string) (DiskUsage, error) + func (*MemFS) PathBase(p string) string + func (*MemFS) PathDir(p string) string + func (*MemFS) PathJoin(elem ...string) string + func (y *MemFS) Create(fullname string) (File, error) + func (y *MemFS) Link(oldname, newname string) error + func (y *MemFS) List(dirname string) ([]string, error) + func (y *MemFS) Lock(fullname string) (io.Closer, error) + func (y *MemFS) MkdirAll(dirname string, perm os.FileMode) error + func (y *MemFS) Open(fullname string, opts ...OpenOption) (File, error) + func (y *MemFS) OpenDir(fullname string) (File, error) + func (y *MemFS) OpenReadWrite(fullname string, opts ...OpenOption) (File, error) + func (y *MemFS) Remove(fullname string) error + func (y *MemFS) RemoveAll(fullname string) error + func (y *MemFS) Rename(oldname, newname string) error + func (y *MemFS) ResetToSyncedState() + func (y *MemFS) ReuseForWrite(oldname, newname string) (File, error) + func (y *MemFS) SetIgnoreSyncs(ignoreSyncs bool) + func (y *MemFS) Stat(name string) (os.FileInfo, error) + func (y *MemFS) String() string + func (y *MemFS) UseWindowsSemantics(windowsSemantics bool) + type OpType uint8 + const OpTypeCreate + const OpTypeLink + const OpTypeMkdirAll + const OpTypePreallocate + const OpTypeRemove + const OpTypeRemoveAll + const OpTypeRename + const OpTypeReuseForWrite + const OpTypeSync + const OpTypeSyncData + const OpTypeSyncTo + const OpTypeUnknown + const OpTypeWrite + func (o OpType) String() string + type OpenOption interface + Apply func(File) + var RandomReadsOption OpenOption = &randomReadsOption{} + var SequentialReadsOption OpenOption = &sequentialReadsOption{} + type SyncingFileOptions struct + BytesPerSync int + NoSyncOnClose bool + PreallocateSize int