virtfs

package module
v0.0.0-...-77e06b8 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeFS - directory in local filesystem.
	TypeFS = 1
	// TypeHTTP - directory served by HTTP web server.
	TypeHTTP = 2
)
View Source
const (
	// AddFirst is used to add a path to the beginning of the list.
	AddFirst = 0
	// AddLast is used to add a path to the end of the list.
	AddLast = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type VFile

type VFile struct {
	Location VLocation
	Name     string
	// contains filtered or unexported fields
}

func (*VFile) Close

func (f *VFile) Close() error

func (*VFile) Open

func (f *VFile) Open() error

func (*VFile) Read

func (f *VFile) Read(p []byte) (n int, err error)

func (*VFile) ReadAll

func (f *VFile) ReadAll() ([]byte, error)

type VLocation

type VLocation struct {
	Path string
	Type int
}

type VirtFS

type VirtFS struct {
	PathList list.List
}

VirtFS manages list of paths.

func (*VirtFS) AddPath

func (v *VirtFS) AddPath(resPath string, resType int, priority int)

AddPath adds a path to the list with selected type and priority.

func (*VirtFS) Open

func (v *VirtFS) Open(name string) (VFile, error)

Open searches and tries to open the given file.

func (*VirtFS) RemovePath

func (v *VirtFS) RemovePath(resPath string, resType int) bool

RemovePath removes paths matching a given path and type.

func (*VirtFS) Stat

func (v *VirtFS) Stat(name string) (os.FileInfo, error)

Stat searches and returns a FileInfo describing the file.

Jump to

Keyboard shortcuts

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