google_drive

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ICONURL = "./img/driver/GoogleDrive.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"`
	OrderBy        string `json:"order_by" type:"string" help:"such as: folder,name,modifiedTime" omit:"true"`
	OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" omit:"true"`
	ClientID       string `json:"client_id" required:"true" default:"" omit:"true"`
	ClientSecret   string `json:"client_secret" required:"true" default:"" omit:"true"`
	ChunkSize      int64  `json:"chunk_size" type:"number" help:"chunk size while uploading (unit: MB)" omit:"true"`
	AuthUrl        string `json:"auth_url" type:"string" default:""`
	Icon           string `json:"icon" type:"string" default:"./img/driver/GoogleDrive.svg"`
	Code           string `json:"code" type:"string" help:"code from auth_url" omit:"true"`
}

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 {
	Id              string    `json:"id"`
	Name            string    `json:"name"`
	MimeType        string    `json:"mimeType"`
	ModifiedTime    time.Time `json:"modifiedTime"`
	Size            string    `json:"size"`
	ThumbnailLink   string    `json:"thumbnailLink"`
	ShortcutDetails struct {
		TargetId       string `json:"targetId"`
		TargetMimeType string `json:"targetMimeType"`
	} `json:"shortcutDetails"`
}

type Files

type Files struct {
	NextPageToken string `json:"nextPageToken"`
	Files         []File `json:"files"`
}

type GoogleDrive

type GoogleDrive struct {
	model.StorageA
	Addition
	AccessToken string
}

func GetConfig

func GetConfig() GoogleDrive

func (*GoogleDrive) Config

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

func (*GoogleDrive) Copy

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

func (*GoogleDrive) Drop

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

func (*GoogleDrive) GetAddition

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

func (*GoogleDrive) GetInfo

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

func (*GoogleDrive) GetUserInfo

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

func (*GoogleDrive) Init

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

func (*GoogleDrive) List

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

func (*GoogleDrive) MakeDir

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

func (*GoogleDrive) Move

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

func (*GoogleDrive) Put

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

func (*GoogleDrive) Remove

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

func (*GoogleDrive) Rename

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

type TokenError

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

type UserInfo

type UserInfo struct {
	User struct {
		Kind         string `json:"kind"`
		DisplayName  string `json:"displayName"`
		PhotoLink    string `json:"photoLink"`
		Me           bool   `json:"me"`
		PermissionID string `json:"permissionId"`
		EmailAddress string `json:"emailAddress"`
	} `json:"user"`
}

Jump to

Keyboard shortcuts

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