Documentation ¶
Overview ¶
Package netstorage provides interfacing the Akamai Netstorage(File/Object Store) API http(s) call
Index ¶
- type Netstorage
- func (ns *Netstorage) Delete(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Dir(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Download(path ...string) (*http.Response, string, error)
- func (ns *Netstorage) Du(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Mkdir(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Mtime(nsPath string, mtime int64) (*http.Response, string, error)
- func (ns *Netstorage) QuickDelete(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Rename(nsTarget, nsDestination string) (*http.Response, string, error)
- func (ns *Netstorage) Rmdir(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Stat(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Symlink(nsTarget, nsDestination string) (*http.Response, string, error)
- func (ns *Netstorage) Upload(localSource, nsDestination string) (*http.Response, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Netstorage ¶
Netstorage struct provides all the necessary fields to create authorization headers. They are on the Akamai Netstorage account page. Hostname format should be "-nsu.akamaihd.net" and Note that don't expose Key on public repository. "Ssl" element is decided by "NetNetstorage" function - string "s" means https and "" does http.
func NewNetstorage ¶
func NewNetstorage(hostname, keyname, key string, ssl bool) *Netstorage
NewNetstorage func creates and initiates Netstorage struct. ssl parameter decides https(true) and http(false) which means "s" and "".
func (*Netstorage) Download ¶
Download returns the string "Download done" when the download completes. The first parameter is Netstorage source path and the second is Local destination path. If you put only the first parameter, it downloads to current local path with the first parameter's file name. From the third parameters will be ignored. Note that you can downlad only a file, not a directory.
func (*Netstorage) QuickDelete ¶
QuickDelete deletes a directory (i.e., recursively delete a directory tree) In order to use this func, you need to the privilege on the CP Code.
func (*Netstorage) Upload ¶
Upload uploads an object. The first parameter is the local source path and the second is the Netstorage destination path. If you put the directory path on "nsDestination" parameter, that filename will be the "localSource" parameter filename. Note that you can upload only a file, not a directory.