MCPcopy
hub / github.com/GopeedLab/gopeed / Fetcher

Interface Fetcher

internal/fetcher/fetcher.go:13–32  ·  view source on GitHub ↗

Fetcher defines the interface for a download protocol. Each download task will have a corresponding Fetcher instance for the management of the download task

Source from the content-addressed store, hash-verified

11// Fetcher defines the interface for a download protocol.
12// Each download task will have a corresponding Fetcher instance for the management of the download task
13type Fetcher interface {
14 Setup(ctl *controller.Controller)
15 Resolve(req *base.Request, opts *base.Options) error
16 Start() error
17 // Patch modifies task-specific data based on the protocol.
18 // For HTTP: can modify Request info (URL, headers, etc.)
19 // For BT: can modify SelectFiles (via opts.SelectFiles)
20 Patch(req *base.Request, opts *base.Options) error
21 Pause() error
22 Close() error
23
24 // Stats refreshes health statistics and returns the latest information
25 Stats() any
26 // Meta returns the meta information of the download.
27 Meta() *FetcherMeta
28 // Progress returns the progress of the download.
29 Progress() Progress
30 // Wait for the download to complete, this method will block until the download is done.
31 Wait() error
32}
33
34type Uploader interface {
35 Upload() error

Callers 151

buildFetcherFunction · 0.65
buildConfigFetcherFunction · 0.65
TestFetcher_ResolveFunction · 0.65
downloadResumeFunction · 0.65
downloadWithProxyFunction · 0.65
buildFetcherFunction · 0.65
buildConfigFetcherFunction · 0.65
ResolveFunction · 0.65
ResolveMethod · 0.65
doStartMethod · 0.65

Implementers 3

Fetcherinternal/protocol/bt/fetcher.go
Fetcherinternal/protocol/ed2k/fetcher.go
Fetcherinternal/protocol/http/fetcher.go

Calls

no outgoing calls

Tested by

no test coverage detected