vfs

package
v0.0.0-...-93a8726 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFS = gvfs.Default

DefaultFS is a vfs instance using underlying OS fs.

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 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 MemStrictFS IFS = gvfs.NewStrictMem()

MemStrictFS is a vfs instance using memfs.

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.

Jump to

Keyboard shortcuts

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