Documentation
¶
Overview ¶
Package http provides a filesystem interface using golang.org/net/http
It treats HTML pages served from the endpoint as directory listings, and includes any links found as files.
Index ¶
- func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error)
- type Fs
- func (f *Fs) Features() *fs.Features
- func (f *Fs) Hashes() hash.Set
- func (f *Fs) List(dir string) (entries fs.DirEntries, err error)
- func (f *Fs) Mkdir(dir string) error
- func (f *Fs) Name() string
- func (f *Fs) NewObject(remote string) (fs.Object, error)
- func (f *Fs) Precision() time.Duration
- func (f *Fs) Put(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) PutStream(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) Rmdir(dir string) error
- func (f *Fs) Root() string
- func (f *Fs) String() string
- type Object
- func (o *Object) Fs() fs.Info
- func (o *Object) Hash(r hash.Type) (string, error)
- func (o *Object) MimeType() string
- func (o *Object) ModTime() time.Time
- func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error)
- func (o *Object) Remote() string
- func (o *Object) Remove() error
- func (o *Object) SetModTime(modTime time.Time) error
- func (o *Object) Size() int64
- func (o *Object) Storable() bool
- func (o *Object) String() string
- func (o *Object) Update(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fs ¶
type Fs struct {
// contains filtered or unexported fields
}
Fs stores the interface to the remote HTTP files
func (*Fs) List ¶
func (f *Fs) List(dir string) (entries fs.DirEntries, err error)
List the objects and directories in dir into entries. The entries can be returned in any order but should be for a complete directory.
dir should be "" to list the root, and should not have trailing slashes.
This should return ErrDirNotFound if the directory isn't found.
func (*Fs) Precision ¶
Precision is the remote http file system's modtime precision, which we have no way of knowing. We estimate at 1s
func (*Fs) Put ¶
func (f *Fs) Put(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
Put in to the remote path with the modTime given of the given size
May create the object even if it returns an error - if so will return the object and the error, otherwise will return nil and the error
func (*Fs) PutStream ¶
func (f *Fs) PutStream(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
PutStream uploads to the remote path with the modTime given of indeterminate size
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object is a remote object that has been stat'd (so it exists, but is not necessarily open for reading)
func (*Object) Hash ¶
Hash returns "" since HTTP (in Go or OpenSSH) doesn't support remote calculation of hashes
func (*Object) Open ¶
func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error)
Open a remote http file object for reading. Seek is supported
func (*Object) SetModTime ¶
SetModTime sets the modification and access time to the specified time
it also updates the info field
func (*Object) Storable ¶
Storable returns whether the remote http file is a regular file (not a directory, symbolic link, block device, character device, named pipe, etc)
func (*Object) Update ¶
func (o *Object) Update(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
Update in to the object with the modTime given of the given size