vfs

package
v4.0.0-...-1d6e2d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInjected = gvfs.ErrInjected

ErrInjected is an error injected for testing purposes.

View Source
var OpRead = gvfs.OpRead

OpRead describes read operations

View Source
var OpSync = gvfs.OpSync

OpSync describes the fsync operation

View Source
var OpWrite = gvfs.OpWrite

OpWrite describes write operations

Functions

func Clean

func Clean(dir string) string

Clean is a wrapper for filepath.Clean.

func IsExist

func IsExist(err error) bool

IsExist returns a boolean value indicating whether the specified error is to indicate that a file or directory already exists.

func IsNotExist

func IsNotExist(err error) bool

IsNotExist returns a boolean value indicating whether the specified error is to indicate that a file or directory does not exist.

func NewPebbleFS

func NewPebbleFS(fs IFS) pvfs.FS

NewPebbleFS creates a new pebble/vfs.FS instance.

func ReportLeakedFD

func ReportLeakedFD(fs IFS, t *testing.T)

ReportLeakedFD reports leaked file fds.

func TempDir

func TempDir() string

TempDir returns the directory use for storing temporary files.

Types

type ErrorFS

type ErrorFS = gvfs.ErrorFS

ErrorFS is a gvfs.FS implementation.

func Wrap

func Wrap(fs IFS, inj Injector) *ErrorFS

Wrap wraps an existing IFS implementation with the specified injector.

type File

type File = gvfs.File

File is the file interface returned by IFS.

type IFS

type IFS = gvfs.FS

IFS is the vfs interface used by dragonboat.

var DefaultFS IFS = gvfs.Default

DefaultFS is a vfs instance using underlying OS fs.

var MemStrictFS IFS = gvfs.NewStrictMem()

MemStrictFS is a vfs instance using memfs.

func GetFS

func GetFS() IFS

GetFS returns the vfs instance used in normal run.

func GetTestFS

func GetTestFS() IFS

GetTestFS returns the vfs instance used in tests.

func NewMemFS

func NewMemFS() IFS

NewMemFS creates a in-memory fs.

type InjectIndex

type InjectIndex = gvfs.InjectIndex

InjectIndex implements Injector

func OnIndex

func OnIndex(index int32, op Op) *InjectIndex

OnIndex creates and returns an injector instance that returns an ErrInjected on the (n+1)-th invocation of its MaybeError function.

type Injector

type Injector = gvfs.Injector

Injector injects errors into FS.

type MemFS

type MemFS = gvfs.MemFS

MemFS is a memory backed file system for testing purposes.

type Op

type Op = gvfs.Op

Op is an enum describing the type of FS operations.

type PebbleFS

type PebbleFS struct {
	// contains filtered or unexported fields
}

PebbleFS is a wrapper struct that implements the pebble/vfs.FS interface.

func (*PebbleFS) Create

func (p *PebbleFS) Create(name string) (pvfs.File, error)

Create ...

func (*PebbleFS) GetDiskUsage

func (p *PebbleFS) GetDiskUsage(path string) (pvfs.DiskUsage, error)

GetDiskUsage ...

func (p *PebbleFS) Link(oldname, newname string) error

Link ...

func (*PebbleFS) List

func (p *PebbleFS) List(dir string) ([]string, error)

List ...

func (*PebbleFS) Lock

func (p *PebbleFS) Lock(name string) (io.Closer, error)

Lock ...

func (*PebbleFS) MkdirAll

func (p *PebbleFS) MkdirAll(dir string, perm os.FileMode) error

MkdirAll ...

func (*PebbleFS) Open

func (p *PebbleFS) Open(name string, opts ...pvfs.OpenOption) (pvfs.File, error)

Open ...

func (*PebbleFS) OpenDir

func (p *PebbleFS) OpenDir(name string) (pvfs.File, error)

OpenDir ...

func (*PebbleFS) PathBase

func (p *PebbleFS) PathBase(path string) string

PathBase ...

func (*PebbleFS) PathDir

func (p *PebbleFS) PathDir(path string) string

PathDir ...

func (*PebbleFS) PathJoin

func (p *PebbleFS) PathJoin(elem ...string) string

PathJoin ...

func (*PebbleFS) Remove

func (p *PebbleFS) Remove(name string) error

Remove ...

func (*PebbleFS) RemoveAll

func (p *PebbleFS) RemoveAll(name string) error

RemoveAll ...

func (*PebbleFS) Rename

func (p *PebbleFS) Rename(oldname, newname string) error

Rename ...

func (*PebbleFS) ReuseForWrite

func (p *PebbleFS) ReuseForWrite(oldname, newname string) (pvfs.File, error)

ReuseForWrite ...

func (*PebbleFS) Stat

func (p *PebbleFS) Stat(name string) (os.FileInfo, error)

Stat ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL