Versions in this module Expand all Collapse all v0 v0.0.9 Sep 23, 2021 Changes in this version + var ErrNotDirectory = errors.New("file isn't a directory") + var ErrNotReader = errors.New("file isn't a regular file") + var ErrNotSupported = errors.New("operation not supported") + func Walk(nd Node, cb func(fpath string, nd Node) error) error + func WriteTo(nd Node, fpath string) error + type DirEntry interface + Name func() string + Node func() Node + func FileEntry(name string, file Node) DirEntry + type DirIterator interface + Err func() error + Next func() bool + type Directory interface + Entries func() DirIterator + func DirFromEntry(e DirEntry) Directory + func NewFileFromPartReader(reader *multipart.Reader, mediatype string) (Directory, error) + func NewMapDirectory(f map[string]Node) Directory + func NewSliceDirectory(files []DirEntry) Directory + func ToDir(n Node) Directory + type File interface + func FileFromEntry(e DirEntry) File + func NewBytesFile(b []byte) File + func NewLinkFile(target string, stat os.FileInfo) File + func NewReaderFile(reader io.Reader) File + func NewReaderStatFile(reader io.Reader, stat os.FileInfo) File + func ToFile(n Node) File + type FileInfo interface + AbsPath func() string + Stat func() os.FileInfo + type Filter struct + IncludeHidden bool + Rules *ignore.GitIgnore + func NewFilter(ignoreFile string, rules []string, includeHidden bool) (*Filter, error) + func (filter *Filter) ShouldExclude(fileInfo os.FileInfo) (result bool) + type MultiFileReader struct + func NewMultiFileReader(file Directory, form bool) *MultiFileReader + func (mfr *MultiFileReader) Boundary() string + func (mfr *MultiFileReader) Read(buf []byte) (written int, err error) + type Node interface + Size func() (int64, error) + func NewSerialFile(path string, includeHidden bool, stat os.FileInfo) (Node, error) + func NewSerialFileWithFilter(path string, filter *Filter, stat os.FileInfo) (Node, error) + type ReaderFile struct + func NewReaderPathFile(path string, reader io.ReadCloser, stat os.FileInfo) (*ReaderFile, error) + func (f *ReaderFile) AbsPath() string + func (f *ReaderFile) Close() error + func (f *ReaderFile) Read(p []byte) (int, error) + func (f *ReaderFile) Seek(offset int64, whence int) (int64, error) + func (f *ReaderFile) Size() (int64, error) + func (f *ReaderFile) Stat() os.FileInfo + type SliceFile struct + func (f *SliceFile) Close() error + func (f *SliceFile) Entries() DirIterator + func (f *SliceFile) Length() int + func (f *SliceFile) Size() (int64, error) + type Symlink struct + Target string + func ToSymlink(n Node) *Symlink + func (lf *Symlink) Close() error + func (lf *Symlink) Read(b []byte) (int, error) + func (lf *Symlink) Seek(offset int64, whence int) (int64, error) + func (lf *Symlink) Size() (int64, error) + type TarWriter struct + TarW *tar.Writer + func NewTarWriter(w io.Writer) (*TarWriter, error) + func (w *TarWriter) Close() error + func (w *TarWriter) WriteFile(nd Node, fpath string) error + type WebFile struct + func NewWebFile(url *url.URL) *WebFile + func (wf *WebFile) AbsPath() string + func (wf *WebFile) Close() error + func (wf *WebFile) Read(b []byte) (int, error) + func (wf *WebFile) Seek(offset int64, whence int) (int64, error) + func (wf *WebFile) Size() (int64, error) + func (wf *WebFile) Stat() os.FileInfo