yandex_disk

package
v3.35.2-8Mi Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: AGPL-3.0 Imports: 13 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 {
	RefreshToken   string `json:"refresh_token" required:"true"`
	OrderBy        string `json:"order_by" type:"select" options:"name,path,created,modified,size" default:"name"`
	OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
	driver.RootPath
	ClientID     string `json:"client_id" required:"true" default:"a78d5a69054042fa936f6c77f9a0ae8b"`
	ClientSecret string `json:"client_secret" required:"true" default:"9c119bbb04b346d2a52aa64401936b2b"`
}

type DownResp

type DownResp struct {
	Href      string `json:"href"`
	Method    string `json:"method"`
	Templated bool   `json:"templated"`
}

type ErrResp

type ErrResp struct {
	Message     string `json:"message"`
	Description string `json:"description"`
	Error       string `json:"error"`
}

type File

type File struct {
	//AntivirusStatus string `json:"antivirus_status"`
	Size int64 `json:"size"`
	//CommentIds      struct {
	//	PrivateResource string `json:"private_resource"`
	//	PublicResource  string `json:"public_resource"`
	//} `json:"comment_ids"`
	Name string `json:"name"`
	//Exif struct {
	//	DateTime time.Time `json:"date_time"`
	//} `json:"exif"`
	//Created    time.Time `json:"created"`
	//ResourceId string    `json:"resource_id"`
	Modified time.Time `json:"modified"`
	//MimeType   string    `json:"mime_type"`
	File string `json:"file"`
	//MediaType  string    `json:"media_type"`
	Preview string `json:"preview"`
	Path    string `json:"path"`
	//Sha256     string    `json:"sha256"`
	Type string `json:"type"`
}

type FilesResp

type FilesResp struct {
	Embedded struct {
		Sort   string `json:"sort"`
		Items  []File `json:"items"`
		Limit  int    `json:"limit"`
		Offset int    `json:"offset"`
		Path   string `json:"path"`
		Total  int    `json:"total"`
	} `json:"_embedded"`
	Name string `json:"name"`
	Exif struct {
	} `json:"exif"`
	ResourceId string    `json:"resource_id"`
	Created    time.Time `json:"created"`
	Modified   time.Time `json:"modified"`
	Path       string    `json:"path"`
	CommentIds struct {
	} `json:"comment_ids"`
	Type     string `json:"type"`
	Revision int64  `json:"revision"`
}

type TokenErrResp

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

type UploadResp

type UploadResp struct {
	OperationId string `json:"operation_id"`
	Href        string `json:"href"`
	Method      string `json:"method"`
	Templated   bool   `json:"templated"`
}

type YandexDisk

type YandexDisk struct {
	model.Storage
	Addition
	AccessToken string
}

func (*YandexDisk) Config

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

func (*YandexDisk) Copy

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

func (*YandexDisk) Drop

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

func (*YandexDisk) GetAddition

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

func (*YandexDisk) Init

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

func (*YandexDisk) List

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

func (*YandexDisk) MakeDir

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

func (*YandexDisk) Move

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

func (*YandexDisk) Put

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

func (*YandexDisk) Remove

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

func (*YandexDisk) Rename

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

Jump to

Keyboard shortcuts

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