downloader

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenCmd

func ListenCmd(this Task_t, inStream io.Reader)

func ListenSign

func ListenSign(this Task_t)

func Reduction

func Reduction(txt string) []goutils.Range_t

Types

type Meta_t

type Meta_t struct {
	SgmTrd  int   // 线程数
	Block   int64 // 分片大小,单位:段
	OutFile string
	RawUrl  string
	Size    int64
}

type Options_t

type Options_t struct {
	SgmTrd     int   // 线程数
	Block      int64 // 分片大小,单位:段
	OutPath    string
	OutFile    string
	RawUrl     string
	ConfigFile string
}

type Outer

type Outer struct {
	// contains filtered or unexported fields
}

func NewOuter

func NewOuter(preLen int) *Outer

func (*Outer) Output

func (this *Outer) Output(startTime int64, pace int64, size int64, sgmTrd int)

type Store_t

type Store_t struct {
	FileInfo string
	// contains filtered or unexported fields
}

func NewStore

func NewStore(rawUrl string, size int64, outFile string, cfgFileName string) (*Store_t, error)

func (*Store_t) Close

func (that *Store_t) Close()

func (*Store_t) SendFileAt

func (that *Store_t) SendFileAt(rs io.ReadCloser, w_off int64) error

*

  • 线程安全

func (*Store_t) Sync

func (that *Store_t) Sync(arr []goutils.Range_t)

type Subject_t

type Subject_t interface {
	GetMeta() *Meta_t
	CreateTask(store *Store_t, linker []goutils.Range_t) (Task_t, error)
}

type Task_t

type Task_t interface {
	Download() error
	// control
	Emit(cmd string)
	EmitError(err error)
}

Jump to

Keyboard shortcuts

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