fs

package
v0.0.0-...-32aeb84 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

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

FS is a composite read and write file system

func New

func New(readFS afero.Fs, writeFS afero.Fs) *FS

New creates composite file system

func (*FS) CopyTree

func (f *FS) CopyTree(from, to string) error

CopyTree make a deep copy of directory

func (*FS) Create

func (f *FS) Create(path string) (io.WriteCloser, error)

Create creates new file

func (*FS) DirExists

func (f *FS) DirExists(path string) (bool, error)

DirExists checks if dir exists

func (*FS) HTTP

func (f *FS) HTTP(dir string) http.Handler

HTTP returns http handler for file server

func (*FS) MkDirAll

func (f *FS) MkDirAll(path string) error

MkDirAll creates dir with 0777

func (*FS) Open

func (f *FS) Open(path string) (io.ReadCloser, error)

Open opens file for reading

func (*FS) ReadFile

func (f *FS) ReadFile(path string) ([]byte, error)

ReadFile reads file from read file system

func (*FS) RemoveAll

func (f *FS) RemoveAll(path string) error

RemoveAll removes all from write file system

func (*FS) TreeList

func (f *FS) TreeList(dir string) ([]string, error)

TreeList returns file list of directory tree

func (*FS) WriteFile

func (f *FS) WriteFile(path string, data []byte) error

WriteFile writes file to write file system with 0777

Jump to

Keyboard shortcuts

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