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) DeleteWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Dir(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) DirWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Download(path ...string) (*http.Response, string, error)
- func (ns *Netstorage) DownloadWithContext(ctx context.Context, path ...string) (*http.Response, string, error)
- func (ns *Netstorage) Du(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) DuWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Mkdir(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) MkdirWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Mtime(nsPath string, mtime int64) (*http.Response, string, error)
- func (ns *Netstorage) MtimeWithContext(ctx context.Context, nsPath string, mtime int64) (*http.Response, string, error)
- func (ns *Netstorage) QuickDelete(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) QuickDeleteWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Rename(nsTarget, nsDestination string) (*http.Response, string, error)
- func (ns *Netstorage) RenameWithContext(ctx context.Context, nsTarget, nsDestination string) (*http.Response, string, error)
- func (ns *Netstorage) Rmdir(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) RmdirWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Stat(nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) StatWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
- func (ns *Netstorage) Symlink(nsTarget, nsDestination string) (*http.Response, string, error)
- func (ns *Netstorage) SymlinkWithContext(ctx context.Context, nsTarget, nsDestination string) (*http.Response, string, error)
- func (ns *Netstorage) Upload(localSource, nsDestination string) (*http.Response, string, error)
- func (ns *Netstorage) UploadContent(reader io.Reader, nsDestination string) (*http.Response, string, error)
- func (ns *Netstorage) UploadContentWithContext(ctx context.Context, reader io.Reader, nsDestination string) (*http.Response, string, error)
- func (ns *Netstorage) UploadWithContext(ctx context.Context, 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) DeleteWithContext ¶
func (ns *Netstorage) DeleteWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
DeleteWithContext provides Delete behavior with context
func (*Netstorage) DirWithContext ¶
func (ns *Netstorage) DirWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
DirWithContext provides Dir behavior with context
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 download only a file, not a directory.
func (*Netstorage) DownloadWithContext ¶
func (ns *Netstorage) DownloadWithContext(ctx context.Context, path ...string) (*http.Response, string, error)
DownloadWithContext provides Download behavior with context
func (*Netstorage) DuWithContext ¶
func (ns *Netstorage) DuWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
DuWithContext adds Du behavior with context
func (*Netstorage) MkdirWithContext ¶
func (ns *Netstorage) MkdirWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
MkdirWithContext provides Mkdir behavior with context
func (*Netstorage) MtimeWithContext ¶
func (ns *Netstorage) MtimeWithContext(ctx context.Context, nsPath string, mtime int64) (*http.Response, string, error)
MtimeWithContext provides Mtime behavior with context
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) QuickDeleteWithContext ¶
func (ns *Netstorage) QuickDeleteWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
QuickDeleteWithContext provides QuickDelete behavior with context.
func (*Netstorage) RenameWithContext ¶
func (ns *Netstorage) RenameWithContext(ctx context.Context, nsTarget, nsDestination string) (*http.Response, string, error)
RenameWithContext provides Rename behavior with context.
func (*Netstorage) RmdirWithContext ¶
func (ns *Netstorage) RmdirWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
RmdirWithContext provides Rmdir behavior with context
func (*Netstorage) StatWithContext ¶
func (ns *Netstorage) StatWithContext(ctx context.Context, nsPath string) (*http.Response, string, error)
StatWithContext provides Stat behavior with context
func (*Netstorage) SymlinkWithContext ¶
func (ns *Netstorage) SymlinkWithContext(ctx context.Context, nsTarget, nsDestination string) (*http.Response, string, error)
SymlinkWithContext adds SymLink behavior with context.
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.
func (*Netstorage) UploadContent ¶
func (ns *Netstorage) UploadContent(reader io.Reader, nsDestination string) (*http.Response, string, error)
UploadContent uploads an object directly with its content.
func (*Netstorage) UploadContentWithContext ¶
func (ns *Netstorage) UploadContentWithContext(ctx context.Context, reader io.Reader, nsDestination string) (*http.Response, string, error)
UploadContentWithContext adds UploadContent behavior with context.
func (*Netstorage) UploadWithContext ¶
func (ns *Netstorage) UploadWithContext(ctx context.Context, localSource, nsDestination string) (*http.Response, string, error)
UploadWithContext adds Upload behavior with context.