fs

package
v0.0.0-...-e64b6cb Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyFS = errors.New("Empty FS")
View Source
var ErrReadOnlyFS = errors.New("Read-only filesystem")

Functions

func EmptyFS

func EmptyFS() hackpadfs.FS

func IsWriteMode

func IsWriteMode(mode int) bool

func Parse

func Parse(v string) (_ hackpadfs.FS, err error)

Parse Parse string of os directories map to MergedFS. Example:

  • `w,/backup,_backup;r,/data,data` two dirs:
  • w,/backup,_backup writable, mounted at /backup, local dir ./_backup
  • r,/data,data readonly, mounted at /data, local dir is ./data

Types

type ROfs

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

func NewROfs

func NewROfs(fs hackpadfs.FS) *ROfs

func (*ROfs) Chmod

func (fs *ROfs) Chmod(name string, mode hackpadfs.FileMode) error

Chmod implements hackpadfs.ChmodFS

func (*ROfs) Chtimes

func (fs *ROfs) Chtimes(name string, atime time.Time, mtime time.Time) error

Chtimes implements hackpadfs.ChtimesFS

func (*ROfs) Mkdir

func (fs *ROfs) Mkdir(name string, perm hackpadfs.FileMode) error

Mkdir implements hackpadfs.MkdirFS

func (*ROfs) MkdirAll

func (fs *ROfs) MkdirAll(path string, perm hackpadfs.FileMode) error

MkdirAll implements hackpadfs.MkdirAllFS

func (*ROfs) Open

func (fs *ROfs) Open(name string) (hackpadfs.File, error)

Open implements hackpadfs.FS

func (*ROfs) OpenFile

func (fs *ROfs) OpenFile(name string, flag int, perm hackpadfs.FileMode) (hackpadfs.File, error)

OpenFile implements hackpadfs.OpenFileFS

func (*ROfs) Remove

func (fs *ROfs) Remove(name string) error

Remove implements hackpadfs.RemoveFS

func (*ROfs) Rename

func (fs *ROfs) Rename(oldname, newname string) error

Rename implements hackpadfs.RenameFS

func (*ROfs) Stat

func (fs *ROfs) Stat(name string) (hackpadfs.FileInfo, error)

Stat implements hackpadfs.StatFS

type WebDavFS

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

func NewWebDavFS

func NewWebDavFS(fs hackpadfs.FS) *WebDavFS

func (*WebDavFS) Mkdir

func (w *WebDavFS) Mkdir(ctx context.Context, name string, perm os.FileMode) error

func (*WebDavFS) OpenFile

func (w *WebDavFS) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (_ webdav.File, err error)

func (*WebDavFS) RemoveAll

func (w *WebDavFS) RemoveAll(ctx context.Context, name string) error

func (*WebDavFS) Rename

func (w *WebDavFS) Rename(ctx context.Context, oldName, newName string) error

func (*WebDavFS) Stat

func (w *WebDavFS) Stat(ctx context.Context, name string) (os.FileInfo, error)

type WebDavFile

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

func (*WebDavFile) Close

func (w *WebDavFile) Close() error

func (*WebDavFile) Read

func (w *WebDavFile) Read(p []byte) (n int, err error)

func (*WebDavFile) Readdir

func (w *WebDavFile) Readdir(count int) (fi []fs.FileInfo, err error)

func (*WebDavFile) Seek

func (w *WebDavFile) Seek(offset int64, whence int) (int64, error)

func (*WebDavFile) Stat

func (w *WebDavFile) Stat() (fs.FileInfo, error)

func (*WebDavFile) Write

func (w *WebDavFile) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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