Documentation ¶
Overview ¶
Package netstorage provides an interface to Akamai NetStorage API
Index ¶
- func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error)
- type Du
- type DuInfo
- type File
- type Fs
- func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[string]string) (out interface{}, err error)
- func (f *Fs) Features() *fs.Features
- func (f *Fs) Hashes() hash.Set
- func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error)
- func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) (err error)
- func (f *Fs) Mkdir(ctx context.Context, dir string) error
- func (f *Fs) Name() string
- func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error)
- func (f *Fs) Precision() time.Duration
- func (f *Fs) Purge(ctx context.Context, dir string) error
- func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) Rmdir(ctx context.Context, dir string) error
- func (f *Fs) Root() string
- func (f *Fs) String() string
- type List
- type ListResume
- type Object
- func (o *Object) Fs() fs.Info
- func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error)
- func (o *Object) Md5Sum() string
- func (o *Object) ModTime(ctx context.Context) time.Time
- func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error)
- func (o *Object) Remote() string
- func (o *Object) Remove(ctx context.Context) error
- func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error
- func (o *Object) Size() int64
- func (o *Object) Storable() bool
- func (o *Object) String() string
- func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
- type Options
- type Stat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Du ¶
type Du struct { XMLName xml.Name `xml:"du"` Directory string `xml:"directory,attr"` Duinfo DuInfo `xml:"du-info"` }
Du represents the du xml element of the response
type DuInfo ¶
type DuInfo struct { XMLName xml.Name `xml:"du-info"` Files int64 `xml:"files,attr"` Bytes int64 `xml:"bytes,attr"` }
DuInfo represents the du-info xml element of the response
type File ¶
type File struct { XMLName xml.Name `xml:"file"` Type string `xml:"type,attr"` Name string `xml:"name,attr"` NameBase64 string `xml:"name_base64,attr"` Size int64 `xml:"size,attr"` Md5 string `xml:"md5,attr"` Mtime int64 `xml:"mtime,attr"` Bytes int64 `xml:"bytes,attr"` Files int64 `xml:"files,attr"` Target string `xml:"target,attr"` }
File is an object which holds the information of the file element of the response xml
type Fs ¶
type Fs struct {
// contains filtered or unexported fields
}
Fs stores the interface to the remote HTTP files
func (*Fs) Command ¶
func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[string]string) (out interface{}, err error)
Command the backend to run a named commands: du and symlink
func (*Fs) List ¶
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) ListR ¶
ListR lists the objects and directories of the Fs starting from dir recursively into out.
dir should be "" to start from the root, and should not have trailing slashes.
This should return ErrDirNotFound if the directory isn't found.
It should call callback for each tranche of entries read. These need not be returned in any particular order. If callback returns an error then the listing will stop immediately.
Don't implement this unless you have a more efficient way of listing recursively that doing a directory traversal.
func (*Fs) Mkdir ¶
Mkdir makes the root directory of the Fs object Shouldn't return an error if it already exists
func (*Fs) NewObject ¶
NewObject creates a new remote http file object NewObject finds the Object at remote If it can't be found returns fs.ErrorObjectNotFound If it isn't a file, then it returns fs.ErrorIsDir
func (*Fs) Purge ¶
Purge all files in the directory specified. NetStorage quick-delete is disabled by default AND not instantaneous. Returns fs.ErrorCantPurge when quick-delete fails.
func (*Fs) Put ¶
func (f *Fs) Put(ctx context.Context, 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(ctx context.Context, 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 List ¶
type List struct { XMLName xml.Name `xml:"list"` Files []File `xml:"file"` Resume ListResume `xml:"resume"` }
List is an object which holds the information of the list element of the response xml
type ListResume ¶
ListResume represents the resume xml element of the list
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) ModTime ¶
ModTime returns the modification time of the object
It attempts to read the objects mtime and if that isn't present the LastModified returned in the http headers
func (*Object) Open ¶
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error)
Open an object for read
func (*Object) SetModTime ¶
SetModTime sets the modification and access time to the specified time
type Options ¶
type Options struct { Endpoint string `config:"host"` Account string `config:"account"` Secret string `config:"secret"` Protocol string `config:"protocol"` }
Options defines the configuration for this backend