fs

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Mem = &memfs{files: map[string]*memfile{}}

Mem is a file system backed by memory.

View Source
var OS = &osfs{}

OS is a file system backed by the os package.

Functions

This section is empty.

Types

type File

type File interface {
	io.Closer
	io.Reader
	io.ReaderAt
	io.Seeker
	io.Writer
	io.WriterAt

	Stat() (os.FileInfo, error)
	Sync() error
	Truncate(size int64) error
}

File is the interface compatible with os.File.

type FileSystem

type FileSystem interface {
	OpenFile(name string, flag int, perm os.FileMode) (MmapFile, error)
	CreateLockFile(name string, perm os.FileMode) (LockFile, bool, error)
	Stat(name string) (os.FileInfo, error)
	Remove(name string) error
}

FileSystem represents a virtual file system.

type LockFile

type LockFile interface {
	Unlock() error
}

LockFile represents a lock file.

type MmapFile

type MmapFile interface {
	File
	Mmap(size int64) error
	Slice(start int64, end int64) ([]byte, error)
}

MmapFile represents a memory-mapped file.

Jump to

Keyboard shortcuts

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