Documentation
¶
Overview ¶
Package httpfs implements a net/http FileSystem interface compatible wrapper around absfs.Filer that supports both read and write operations. It bridges the gap between the absfs filesystem abstraction and Go's standard http.FileServer.
Index ¶
- type Httpfs
- func (filer *Httpfs) Chmod(name string, mode os.FileMode) error
- func (filer *Httpfs) Chown(name string, uid, gid int) error
- func (filer *Httpfs) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (filer *Httpfs) Mkdir(name string, perm os.FileMode) error
- func (filer *Httpfs) MkdirAll(name string, perm os.FileMode) error
- func (filer *Httpfs) Open(name string) (http.File, error)
- func (filer *Httpfs) OpenFile(name string, flag int, perm os.FileMode) (absfs.File, error)
- func (filer *Httpfs) ReadDir(name string) ([]fs.DirEntry, error)
- func (filer *Httpfs) ReadFile(name string) ([]byte, error)
- func (filer *Httpfs) Remove(name string) error
- func (filer *Httpfs) RemoveAll(pathname string) error
- func (filer *Httpfs) Stat(name string) (os.FileInfo, error)
- func (filer *Httpfs) Sub(dir string) (fs.FS, error)
- type RemoveAller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Httpfs ¶
type Httpfs struct {
// contains filtered or unexported fields
}
func (*Httpfs) MkdirAll ¶
MkdirAll creates all missing directories in `name` without returning an error for directories that already exist
func (*Httpfs) ReadDir ¶
ReadDir reads the named directory and returns a list of directory entries sorted by filename.
func (*Httpfs) ReadFile ¶
ReadFile reads the named file and returns its contents. A successful call returns err == nil, not err == EOF.
func (*Httpfs) Remove ¶
Remove removes a file identified by name, returning an error, if any happens.
func (*Httpfs) RemoveAll ¶
RemoveAll removes a directory after removing all children of that directory. If the underlying filesystem implements RemoveAller, it delegates to that. Returns nil for non-existent paths (matching os.RemoveAll behavior).
type RemoveAller ¶
RemoveAller is an optional interface that filesystems can implement to provide optimized recursive directory removal.