onedrive

package
v3.34.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addition

type Addition struct {
	driver.RootPath
	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:"https://alist.nn.ci/tool/onedrive/callback"`
	RefreshToken string `json:"refresh_token" required:"true"`
	SiteId       string `json:"site_id"`
	ChunkSize    int64  `json:"chunk_size" type:"number" default:"5"`
	CustomHost   string `json:"custom_host" help:"Custom host for onedrive download link"`
}

type File

type File struct {
	Id             string               `json:"id"`
	Name           string               `json:"name"`
	Size           int64                `json:"size"`
	FileSystemInfo *FileSystemInfoFacet `json:"fileSystemInfo"`
	Url            string               `json:"@microsoft.graph.downloadUrl"`
	File           *struct {
		MimeType string `json:"mimeType"`
	} `json:"file"`
	Thumbnails []struct {
		Medium struct {
			Url string `json:"url"`
		} `json:"medium"`
	} `json:"thumbnails"`
	ParentReference struct {
		DriveId string `json:"driveId"`
	} `json:"parentReference"`
}

type FileSystemInfoFacet added in v3.34.0

type FileSystemInfoFacet struct {
	CreatedDateTime      time.Time `json:"createdDateTime,omitempty"`      // The UTC date and time the file was created on a client.
	LastModifiedDateTime time.Time `json:"lastModifiedDateTime,omitempty"` // The UTC date and time the file was last modified on a client.
}

FileSystemInfoFacet contains properties that are reported by the device's local file system for the local version of an item. This facet can be used to specify the last modified date or created date of the item as it was on the local device.

type Files

type Files struct {
	Value    []File `json:"value"`
	NextLink string `json:"@odata.nextLink"`
}

type Host

type Host struct {
	Oauth string
	Api   string
}

type Metadata added in v3.34.0

type Metadata struct {
	Description    string               `json:"description,omitempty"`    // Provides a user-visible description of the item. Read-write. Only on OneDrive Personal. Undocumented limit of 1024 characters.
	FileSystemInfo *FileSystemInfoFacet `json:"fileSystemInfo,omitempty"` // File system information on client. Read-write.
}

Metadata represents a request to update Metadata. It includes only the writeable properties. omitempty is intentionally included for all, per https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_update?view=odsp-graph-online#request-body

type Object added in v3.7.1

type Object struct {
	model.ObjThumb
	ParentID string
}

type Onedrive

type Onedrive struct {
	model.Storage
	Addition
	AccessToken string
	// contains filtered or unexported fields
}

func (*Onedrive) Config

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

func (*Onedrive) Copy

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

func (*Onedrive) Drop

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

func (*Onedrive) GetAddition

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

func (*Onedrive) GetFile

func (d *Onedrive) GetFile(path string) (*File, error)

func (*Onedrive) GetMetaUrl

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

func (*Onedrive) GetRoot added in v3.30.0

func (d *Onedrive) GetRoot(ctx context.Context) (model.Obj, error)

func (*Onedrive) Init

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

func (*Onedrive) List

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

func (*Onedrive) MakeDir

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

func (*Onedrive) Move

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

func (*Onedrive) Put

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

func (*Onedrive) Remove

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

func (*Onedrive) Rename

func (d *Onedrive) Rename(ctx context.Context, srcObj model.Obj, newName string) 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