pcloud

package
v3.55.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

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)"`
}

func (Addition) GetRootId

func (a Addition) GetRootId() string

Implement IRootId interface

type DownloadLinkResult

type DownloadLinkResult struct {
	Result int      `json:"result"`
	Hosts  []string `json:"hosts"`
	Path   string   `json:"path"`
}

DownloadLinkResult represents download link response

type ErrorResult

type ErrorResult struct {
	Result int    `json:"result"`
	Error  string `json:"error"`
}

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) Config

func (d *PCloud) Config() driver.Config

func (*PCloud) Copy

func (d *PCloud) Copy(ctx context.Context, srcObj, dstDir model.Obj) error

Copy implements driver.Copy

func (*PCloud) Drop

func (d *PCloud) Drop(ctx context.Context) error

func (*PCloud) GetAddition

func (d *PCloud) GetAddition() driver.Additional

func (*PCloud) Init

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 (*PCloud) List

func (d *PCloud) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*PCloud) MakeDir

func (d *PCloud) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error

Mkdir implements driver.Mkdir

func (*PCloud) Move

func (d *PCloud) Move(ctx context.Context, srcObj, dstDir model.Obj) error

Move implements driver.Move

func (*PCloud) Put

func (d *PCloud) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error

Put implements driver.Put

func (*PCloud) Remove

func (d *PCloud) Remove(ctx context.Context, obj model.Obj) error

Remove implements driver.Remove

func (*PCloud) Rename

func (d *PCloud) Rename(ctx context.Context, srcObj model.Obj, newName string) error

Rename implements driver.Rename

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
}

TokenResponse represents OAuth token response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL