memfs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package memfs provides a billy filesystem base on memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

Memory a very convenient filesystem based on memory files

func New

func New() *Memory

New returns a new Memory filesystem

func (*Memory) Base

func (fs *Memory) Base() string

Base returns the base path for the filesystem.

func (*Memory) Create

func (fs *Memory) Create(filename string) (billy.File, error)

Create returns a new file in memory from a given filename.

func (*Memory) Dir

func (fs *Memory) Dir(path string) billy.Filesystem

Dir creates a new memory filesystem whose root is the given path inside the current filesystem.

func (*Memory) Join

func (fs *Memory) Join(elem ...string) string

Join concatenatess part of a path together.

func (*Memory) Open

func (fs *Memory) Open(filename string) (billy.File, error)

Open returns a readonly file from a given name.

func (*Memory) OpenFile

func (fs *Memory) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)

OpenFile returns the file from a given name with given flag and permits.

func (*Memory) ReadDir

func (fs *Memory) ReadDir(base string) (entries []billy.FileInfo, err error)

ReadDir returns a list of billy.FileInfo in the given directory.

func (*Memory) Remove

func (fs *Memory) Remove(filename string) error

Remove deletes a given file from storage.

func (*Memory) Rename

func (fs *Memory) Rename(from, to string) error

Rename moves a the `from` file to the `to` file.

func (*Memory) Stat

func (fs *Memory) Stat(filename string) (billy.FileInfo, error)

Stat returns a billy.FileInfo with the information of the requested file.

func (*Memory) TempFile

func (fs *Memory) TempFile(dir, prefix string) (billy.File, error)

TempFile creates a new temporary file.

Jump to

Keyboard shortcuts

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