Documentation
¶
Index ¶
- Variables
- func Clean(dir string) string
- func IsExist(err error) bool
- func IsNotExist(err error) bool
- func NewPebbleFS(fs FS) pbvfs.FS
- func ReportLeakedFD(fs FS, t *testing.T)
- func TempDir() string
- type FS
- type File
- type PebbleFS
- func (p *PebbleFS) Create(name string) (pbvfs.File, error)
- func (p *PebbleFS) GetFreeSpace(path string) (uint64, error)
- func (p *PebbleFS) GetVFS() FS
- func (p *PebbleFS) Link(oldname, newname string) error
- func (p *PebbleFS) List(dir string) ([]string, error)
- func (p *PebbleFS) Lock(name string) (io.Closer, error)
- func (p *PebbleFS) MkdirAll(dir string, perm os.FileMode) error
- func (p *PebbleFS) Open(name string, opts ...pbvfs.OpenOption) (pbvfs.File, error)
- func (p *PebbleFS) OpenDir(name string) (pbvfs.File, error)
- func (p *PebbleFS) PathBase(path string) string
- func (p *PebbleFS) PathDir(path string) string
- func (p *PebbleFS) PathJoin(elem ...string) string
- func (p *PebbleFS) Remove(name string) error
- func (p *PebbleFS) RemoveAll(name string) error
- func (p *PebbleFS) Rename(oldname, newname string) error
- func (p *PebbleFS) ReuseForWrite(oldname, newname string) (pbvfs.File, error)
- func (p *PebbleFS) Stat(name string) (os.FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
var Default = pvfs.Default
Default is the default vfs suppose to be used in production. It is directly backed by the underlying operating system's file system.
var DefaultPebbleFS = NewPebbleFS(Default)
DefaultPebbleFS is the default vfs for pebble suppose to be used in production. It is backed by the underlying operating system's file system.
Functions ¶
func IsExist ¶
IsExist returns a boolean value indicating whether the specified error is to indicate that a file or directory already exists.
func IsNotExist ¶
IsNotExist returns a boolean value indicating whether the specified error is to indicate that a file or directory does not exist.
func NewPebbleFS ¶
NewPebbleFS creates a new pebble/vfs.FS instance.
func ReportLeakedFD ¶
ReportLeakedFD reports leaked file fds.
Types ¶
type FS ¶
FS is a vfs type
func GetTestFS ¶
func GetTestFS() FS
GetTestFS creates and returns a FS instance to be used in tests. A FS backed by memory is returned when the MEMFS environmental variable is set, or it returns a regular Default FS backed by underlying operating system's file system.
func NewMemFS ¶
func NewMemFS() FS
NewMemFS returns a new memory based FS implementation that can be used in tests. You are not suppose to use this in production as nothing is persistently stored.
Ad a "strict" memory-backed FS implementation, in short changes after the last Sync() will be lost after ResetToSyncedState() is called. For more detailed descriptions on its behaviour, see https://github.com/cockroachdb/pebble/blob/master/vfs/vfs.go
type PebbleFS ¶
type PebbleFS struct {
// contains filtered or unexported fields
}
PebbleFS is a wrapper struct that implements the pebble/vfs.FS interface.
func (*PebbleFS) GetFreeSpace ¶
GetFreeSpace ...
func (*PebbleFS) ReuseForWrite ¶
ReuseForWrite ...