vfs

package
v0.0.0-...-57e3cb4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterEngine

func RegisterEngine(name string, fn NewVFSFunc)

Types

type File

type File interface {
	Name() string
	Chmod(mode os.FileMode) error
	Read(buf []byte) (int, error)
	ReadAt(buf []byte, offset int64) (int, error)
	Readdir(n int) ([]os.FileInfo, error)
	Readdirnames(n int) ([]string, error)
	Write(buf []byte) (int, error)
	WriteAt(buf []byte, off int64) (int, error)
	Stat() (os.FileInfo, error)
	Close() error
}

type NewVFSFunc

type NewVFSFunc func(string) (VFS, error)

type ReadOnlyFile

type ReadOnlyFile struct {
	F File
}

func (*ReadOnlyFile) Chmod

func (rof *ReadOnlyFile) Chmod(mode os.FileMode) error

func (*ReadOnlyFile) Close

func (rof *ReadOnlyFile) Close() error

func (*ReadOnlyFile) Name

func (rof *ReadOnlyFile) Name() string

func (*ReadOnlyFile) Read

func (rof *ReadOnlyFile) Read(buf []byte) (int, error)

func (*ReadOnlyFile) ReadAt

func (rof *ReadOnlyFile) ReadAt(buf []byte, offset int64) (int, error)

func (*ReadOnlyFile) Readdir

func (rof *ReadOnlyFile) Readdir(n int) ([]os.FileInfo, error)

func (*ReadOnlyFile) Readdirnames

func (rof *ReadOnlyFile) Readdirnames(n int) ([]string, error)

func (*ReadOnlyFile) Stat

func (rof *ReadOnlyFile) Stat() (os.FileInfo, error)

func (*ReadOnlyFile) Write

func (rof *ReadOnlyFile) Write(buf []byte) (int, error)

func (*ReadOnlyFile) WriteAt

func (rof *ReadOnlyFile) WriteAt(buf []byte, off int64) (int, error)

type ReadOnlyVFS

type ReadOnlyVFS struct {
	Fs VFS
}

func (*ReadOnlyVFS) Chmod

func (rofs *ReadOnlyVFS) Chmod(name string, mode os.FileMode) error

func (*ReadOnlyVFS) Close

func (rofs *ReadOnlyVFS) Close() error

func (*ReadOnlyVFS) Mkdir

func (rofs *ReadOnlyVFS) Mkdir(path string, perm os.FileMode) error

func (*ReadOnlyVFS) Open

func (rofs *ReadOnlyVFS) Open(path string) (File, error)

func (*ReadOnlyVFS) OpenFile

func (rofs *ReadOnlyVFS) OpenFile(name string, flag int, perm os.FileMode) (File, error)

func (*ReadOnlyVFS) Remove

func (rofs *ReadOnlyVFS) Remove(path string) error

func (*ReadOnlyVFS) Rename

func (rofs *ReadOnlyVFS) Rename(from, to string) error

func (*ReadOnlyVFS) Stat

func (rofs *ReadOnlyVFS) Stat(path string) (os.FileInfo, error)

type VFS

type VFS interface {
	Chmod(name string, mode os.FileMode) error
	Open(path string) (File, error)
	OpenFile(name string, flag int, perm os.FileMode) (File, error)
	Mkdir(path string, perm os.FileMode) error
	Stat(path string) (os.FileInfo, error)
	Rename(from, to string) error
	Remove(path string) error
	Close() error
}

func Open

func Open(engineName, params string) (VFS, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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