driver

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRefreshToken = errors.New("aliyun drive need refreshToken")
)

Functions

This section is empty.

Types

type Driver

type Driver interface {
	// Source will return the driver identity.
	Source() Source

	// Resolve the given link and return the file name with the download link.
	Resolve(shareLink string, passcode string) ([]Share, error)

	// Download the given link.
	Download(share Share) (io.ReadCloser, int64, error)
}

Driver is used to resolve the links from a Source.

func New

func New(config *client.Config, properties map[string]string) (Driver, error)

New will create the basic driver service.

type Share

type Share struct {
	// FileName is a file name with the file extension.
	FileName string
	// Size is the file size in bytes.
	Size int64
	// URL is the downloadable url for this file.
	URL string
	// Properties could be some metadata, such as the token for this downloadable share.
	Properties map[string]any
}

Share is an atomic downloadable file.

type Source

type Source string

Source is a net drive disk provider.

const (
	ALIYUN  Source = "aliyun"
	LANZOU  Source = "lanzou"
	TELECOM Source = "telecom"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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