dropbox

package
v0.4.2-alpha6 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const APPKEY = "tciqajyazzdygt9"
View Source
const APPSECRET = "e7gtmv441cwdf0n"
View Source
const ICONURL = "./img/driver/Dropbox.svg"

Variables

This section is empty.

Functions

This section is empty.

Types

type Addition

type Addition struct {
	driver.RootID
	RefreshToken   string `json:"refresh_token" required:"true" omit:"true"`
	AppKey         string `json:"app_key" type:"string" default:"tciqajyazzdygt9" omit:"true"`
	AppSecret      string `json:"app_secret" type:"string" default:"e7gtmv441cwdf0n" omit:"true"`
	OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" omit:"true"`
	AuthUrl        string `` /* 289-byte string literal not displayed */
	Icon           string `json:"icon" type:"string" default:"./img/driver/Dropbox.svg"`
	Code           string `json:"code" type:"string" help:"code from auth_url" omit:"true"`
}

type Dropbox

type Dropbox struct {
	model.Storage
	Addition
	AccessToken string
}

func (*Dropbox) Config

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

func (*Dropbox) Copy

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

func (*Dropbox) Drop

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

func (*Dropbox) GetAddition

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

func (*Dropbox) GetUserInfo

func (d *Dropbox) GetUserInfo(ctx context.Context) (string, error)

func (*Dropbox) Init

func (d *Dropbox) Init(ctx context.Context) error
func (d *Dropbox) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*Dropbox) List

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

func (*Dropbox) MakeDir

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

func (*Dropbox) Move

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

func (*Dropbox) Put

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

func (*Dropbox) Remove

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

func (*Dropbox) Rename

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

type Error

type Error struct {
	Error struct {
		Errors []struct {
			Domain       string `json:"domain"`
			Reason       string `json:"reason"`
			Message      string `json:"message"`
			LocationType string `json:"location_type"`
			Location     string `json:"location"`
		}
		Code    int    `json:"code"`
		Message string `json:"message"`
	} `json:"error"`
}

type File

type File struct {
	Tag            string    `json:".tag"`
	Name           string    `json:"name"`
	PathLower      string    `json:"path_lower"`
	PathDisplay    string    `json:"path_display"`
	ID             string    `json:"id"`
	ClientModified time.Time `json:"client_modified,omitempty"`
	ServerModified time.Time `json:"server_modified,omitempty"`
	Rev            string    `json:"rev,omitempty"`
	Size           int       `json:"size,omitempty"`
	IsDownloadable bool      `json:"is_downloadable,omitempty"`
	ContentHash    string    `json:"content_hash,omitempty"`
}

type Files

type Files struct {
	Files   []File `json:"entries"`
	Cursor  string `json:"cursor"`
	HasMore bool   `json:"has_more"`
}

type TokenError

type TokenError struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

type UserInfo

type UserInfo struct {
	AccountID string `json:"account_id"`
	Name      struct {
		GivenName       string `json:"given_name"`
		Surname         string `json:"surname"`
		FamiliarName    string `json:"familiar_name"`
		DisplayName     string `json:"display_name"`
		AbbreviatedName string `json:"abbreviated_name"`
	} `json:"name"`
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	Disabled      bool   `json:"disabled"`
	Country       string `json:"country"`
	Locale        string `json:"locale"`
	ReferralLink  string `json:"referral_link"`
	IsPaired      bool   `json:"is_paired"`
	AccountType   struct {
		Tag string `json:".tag"`
	} `json:"account_type"`
	RootInfo struct {
		Tag             string `json:".tag"`
		RootNamespaceID string `json:"root_namespace_id"`
		HomeNamespaceID string `json:"home_namespace_id"`
	} `json:"root_info"`
}

Jump to

Keyboard shortcuts

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