Documentation
¶
Index ¶
- type Addition
- type DownloadLinkResult
- type ErrorResult
- type FileObject
- type FolderMeta
- type ItemResult
- type PCloud
- func (d *PCloud) Config() driver.Config
- func (d *PCloud) Copy(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *PCloud) Drop(ctx context.Context) error
- func (d *PCloud) GetAddition() driver.Additional
- func (d *PCloud) Init(ctx context.Context) error
- func (d *PCloud) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *PCloud) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *PCloud) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error
- func (d *PCloud) Move(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *PCloud) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, ...) error
- func (d *PCloud) Remove(ctx context.Context, obj model.Obj) error
- func (d *PCloud) Rename(ctx context.Context, srcObj model.Obj, newName string) error
- type TokenResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addition ¶
type Addition struct {
// Using json tag "access_token" for UI display, but internally it's a refresh token
RefreshToken string `json:"access_token" required:"true" help:"OAuth token from pCloud authorization"`
Hostname string `json:"hostname" type:"select" options:"us,eu" default:"us" help:"Select pCloud server region"`
RootFolderID string `` /* 141-byte string literal not displayed */
ClientID string `json:"client_id" help:"Custom OAuth client ID (optional)"`
ClientSecret string `json:"client_secret" help:"Custom OAuth client secret (optional)"`
}
type DownloadLinkResult ¶
type DownloadLinkResult struct {
Result int `json:"result"`
Hosts []string `json:"hosts"`
Path string `json:"path"`
}
DownloadLinkResult represents download link response
type ErrorResult ¶
ErrorResult represents a pCloud API error response
type FileObject ¶
type FileObject struct {
Name string `json:"name"`
Created string `json:"created"` // pCloud returns RFC1123 format string
Modified string `json:"modified"` // pCloud returns RFC1123 format string
IsFolder bool `json:"isfolder"`
FolderID uint64 `json:"folderid,omitempty"`
FileID uint64 `json:"fileid,omitempty"`
Size uint64 `json:"size"`
ParentID uint64 `json:"parentfolderid"`
Icon string `json:"icon,omitempty"`
Hash uint64 `json:"hash,omitempty"`
Category int `json:"category,omitempty"`
ID string `json:"id,omitempty"`
}
FileObject represents a file or folder object in pCloud
type FolderMeta ¶
type FolderMeta struct {
Contents []FileObject `json:"contents,omitempty"`
}
FolderMeta contains folder metadata including contents
type ItemResult ¶
type ItemResult struct {
Result int `json:"result"`
Metadata *FolderMeta `json:"metadata,omitempty"`
}
ItemResult represents a common pCloud API response
type PCloud ¶
type PCloud struct {
model.Storage
Addition
AccessToken string // Actual access token obtained from refresh token
}
func (*PCloud) GetAddition ¶
func (d *PCloud) GetAddition() driver.Additional
func (*PCloud) Put ¶
func (d *PCloud) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error
Put implements driver.Put
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
}
TokenResponse represents OAuth token response
Click to show internal directories.
Click to hide internal directories.