onedrive

package
v0.4.4-alpha7 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ICONURL = "./img/driver/OneDrive.svg"

Variables

This section is empty.

Functions

func EncodePath

func EncodePath(path string, all ...bool) string

Types

type About

type About struct {
	Total int    `json:"total"`
	Used  int    `json:"used"`
	State string `json:"state"`
}

type Addition

type Addition struct {
	Region       string `json:"region" type:"select" required:"true" options:"global,cn,us,de" default:"global"`
	IsSharepoint bool   `json:"is_sharepoint"`
	ClientID     string `json:"client_id" required:"true"`
	ClientSecret string `json:"client_secret" required:"true"`
	RedirectUri  string `json:"redirect_uri" required:"true" default:""`
	RefreshToken string `json:"refresh_token" required:"true"`
	SiteId       string `json:"site_id"`
	ChunkSize    int64  `json:"chunk_size" type:"number" default:"5"`
	RootFolderID string `json:"root_folder_id"`
	AuthUrl      string `json:"auth_url" type:"string" default:""`
	Icon         string `json:"icon" type:"string" default:""`
	Code         string `json:"code" type:"string" help:"code from auth_url" omit:"true"`
}

type Host

type Host struct {
	Oauth string
	Api   string
}

type Info

type Info struct {
	LastModifiedBy struct {
		Application struct {
			DisplayName string `json:"displayName"`
			ID          string `json:"id"`
		} `json:"application"`
		Device struct {
			ID string `json:"id"`
		} `json:"device"`
		User struct {
			DisplayName string `json:"displayName"`
			ID          string `json:"id"`
		} `json:"user"`
	} `json:"lastModifiedBy"`
	ParentReference struct {
		DriveID   string `json:"driveId"`
		DriveType string `json:"driveType"`
	} `json:"parentReference"`
}

type Onedrive

type Onedrive struct {
	model.StorageA
	Addition
	AccessToken string
}

func GetConfig

func GetConfig() Onedrive

func (*Onedrive) Config

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

func (*Onedrive) Drop

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

func (*Onedrive) GetAddition

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

func (*Onedrive) GetInfo

func (d *Onedrive) GetInfo(ctx context.Context) (string, string, string, error)

func (*Onedrive) GetMetaUrl

func (d *Onedrive) GetMetaUrl(auth bool, path string) string

func (*Onedrive) GetSpaceSize

func (d *Onedrive) GetSpaceSize(ctx context.Context) (used string, total string, err error)

func (*Onedrive) GetUserInfo

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

func (*Onedrive) Init

func (d *Onedrive) Init(ctx context.Context) error

func (*Onedrive) Request

func (d *Onedrive) Request(url string, method string, callback base.ReqCallback, resp interface{}) ([]byte, error)

type RespErr

type RespErr struct {
	Error struct {
		Code    string `json:"code"`
		Message string `json:"message"`
	} `json:"error"`
}

type TokenErr

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

Jump to

Keyboard shortcuts

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