_115

package
v0.0.0-...-6e53ccd Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitFile

func SplitFile(fileSize int64) (chunks []oss.FileChunk, err error)

func SplitFileByPartNum

func SplitFileByPartNum(fileSize int64, chunkNum int) ([]oss.FileChunk, error)

SplitFileByPartNum splits big file into parts by the num of parts. Split the file with specified parts count, returns the split result when error is nil.

func SplitFileByPartSize

func SplitFileByPartSize(fileSize int64, chunkSize int64) ([]oss.FileChunk, error)

SplitFileByPartSize splits big file into parts by the size of parts. Splits the file by the part size. Returns the FileChunk when error is nil.

func UploadDigestRange

func UploadDigestRange(stream model.FileStreamer, rangeSpec string) (result string, err error)

Types

type Addition

type Addition struct {
	Cookie       string  `json:"cookie" type:"text" help:"one of QR code token and cookie required"`
	QRCodeToken  string  `json:"qrcode_token" type:"text" help:"one of QR code token and cookie required"`
	QRCodeSource string  `` /* 158-byte string literal not displayed */
	PageSize     int64   `json:"page_size" type:"number" default:"1000" help:"list api per page size of 115 driver"`
	LimitRate    float64 `json:"limit_rate" type:"float" default:"2" help:"limit all api request rate ([limit]r/1s)"`
	driver.RootID
}

type FileObj

type FileObj struct {
	driver.File
}

func (*FileObj) CreateTime

func (f *FileObj) CreateTime() time.Time

func (*FileObj) GetHash

func (f *FileObj) GetHash() utils.HashInfo

type Pan115

type Pan115 struct {
	model.Storage
	Addition
	// contains filtered or unexported fields
}

func (*Pan115) Config

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

func (*Pan115) Copy

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

func (*Pan115) DeleteOfflineTasks

func (d *Pan115) DeleteOfflineTasks(ctx context.Context, hashes []string, deleteFiles bool) error

func (*Pan115) DownloadWithUA

func (d *Pan115) DownloadWithUA(pickCode, ua string) (*driver115.DownloadInfo, error)

func (*Pan115) Drop

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

func (*Pan115) GenerateToken

func (c *Pan115) GenerateToken(fileID, preID, timeStamp, fileSize, signKey, signVal string) string

func (*Pan115) GetAddition

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

func (*Pan115) Init

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

func (*Pan115) List

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

func (*Pan115) MakeDir

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

func (*Pan115) Move

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

func (*Pan115) OfflineDownload

func (d *Pan115) OfflineDownload(ctx context.Context, uris []string, dstDir model.Obj) ([]string, error)

func (*Pan115) OfflineList

func (d *Pan115) OfflineList(ctx context.Context) ([]*driver115.OfflineTask, error)

func (*Pan115) Put

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

func (*Pan115) Remove

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

func (*Pan115) Rename

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

func (*Pan115) UploadByMultipart

func (d *Pan115) UploadByMultipart(ctx context.Context, params *driver115.UploadOSSParams, fileSize int64, s model.FileStreamer,
	dirID string, up driver.UpdateProgress, opts ...driver115.UploadMultipartOption) (*UploadResult, error)

UploadByMultipart upload by mutipart blocks

func (*Pan115) UploadByOSS

UploadByOSS use aliyun sdk to upload

func (*Pan115) WaitLimit

func (d *Pan115) WaitLimit(ctx context.Context) error

type UploadResult

type UploadResult struct {
	driver.BasicResp
	Data struct {
		PickCode string `json:"pick_code"`
		FileSize int    `json:"file_size"`
		FileID   string `json:"file_id"`
		ThumbURL string `json:"thumb_url"`
		Sha1     string `json:"sha1"`
		Aid      int    `json:"aid"`
		FileName string `json:"file_name"`
		Cid      string `json:"cid"`
		IsVideo  int    `json:"is_video"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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