driver

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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(link, 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
	// SubPath The path for saving the files.
	SubPath 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"
	BAIDU   Source = "baidu"
	CTFILE  Source = "ctfile"
	QUARK   Source = "quark"
	DIRECT  Source = "direct"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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