fs

package module
v0.0.0-...-c9365a2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2015 License: MIT Imports: 7 Imported by: 0

README

fs

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIsDir = errors.New("is a directory")
View Source
var ErrIsFile = errors.New("is a file")
View Source
var ErrIsNotRegular = errors.New("is not a regular file")

Functions

func NewDir

func NewDir(path string) *dir

func NewFile

func NewFile(path string) *file

Types

type Dir

type Dir interface {
	Path() string
	Parent() Dir
	Up(level int) Dir
	Name() string
	Remove() error
	RemoveAll() error
	Exists() (bool, error)
	Rename(string) error
	Join(...string) string
	// like os.File.ReadDir
	Files() ([]File, error)
	Dirs() ([]Dir, error)
	// like filepath.Walk
	Create() error
	CreateAll() error
	Walk(func(File) error, func(Dir) error) error
}

type File

type File interface {
	Name() string
	Path() string
	Parent() Dir
	Remove() error
	Extension() string
	BareName() string
	Exists() (bool, error)
	ReadAll() ([]byte, error)
	WriteAll([]byte) error
	Read(func(io.Reader) error) error
	// Write will create the file if it does not exist
	Write(func(io.Writer) error) error
	Rename(string) error
	MimeType() string
}

type LocalDir

type LocalDir interface {
	Move(dir string) error
	LoadInfo() error
	Info() (os.FileInfo, error)
	ReadDir(n int) ([]os.FileInfo, error)
}

type LocalFile

type LocalFile interface {
	Copy(path string) error
	// like os.OpenFile
	OpenFile(flag int, perm os.FileMode) (*os.File, error)
	Move(dir string) error
	Info() (os.FileInfo, error)
	LoadInfo() error
}

Jump to

Keyboard shortcuts

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