vfs

package
v3.2.7-0...-70c9be9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 TempDir

func TempDir() string

TempDir returns the directory use for storing temporary files.

Types

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.

type MemFS

type MemFS = gvfs.MemFS

MemFS is a memory backed file system for testing purposes.

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 (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