Documentation
¶
Overview ¶
Package httpfs exposes a directory on the disk via a HTTP inteface with r/w access.
Only the GET/POST verbs are used, GET is used for read-only access to directories and files. POST is used to write files, the path to a file is created. There is no way to create a directory without creating a new file
This package is purely experimental and can change at any time, if you are using it just let me know.
Index ¶
- Variables
- func DeepReadTo(out io.Writer, in File, depth int) error
- func ReadFileTo(out io.Writer, in File) error
- func Truncate(in File) error
- func WriteToFile(out File, in io.Reader) error
- type DiskFile
- func (df *DiskFile) Childs() ([]string, error)
- func (df *DiskFile) Create(name string, isdir bool) (File, error)
- func (df *DiskFile) Info() Info
- func (df *DiskFile) Open(name string) (File, error)
- func (df *DiskFile) Reader() (io.ReadCloser, error)
- func (df *DiskFile) Truncate() error
- func (df *DiskFile) Writer() (io.WriteCloser, error)
- type File
- type Handler
- type Info
- type ReadArgs
- type TreeNode
- type Truncable
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCannotWrite = errors.New("cannot write") ErrCannotRead = errors.New("cannot read") ErrCannotWriteToDir = errors.New("cannot write to directory") ErrCannotTruncate = errors.New("file don't allow truncate") ErrCannotCreate = errors.New("cannot create the file") ErrNotFound = errors.New("file not found") )
Functions ¶
Types ¶
type DiskFile ¶
type DiskFile struct {
// contains filtered or unexported fields
}
Represent a actual disk file
type File ¶
type File interface { Info() Info Open(name string) (File, error) Reader() (io.ReadCloser, error) Writer() (io.WriteCloser, error) Childs() ([]string, error) Create(name string, isDir bool) (File, error) }
func NewDiskFile ¶
Click to show internal directories.
Click to hide internal directories.