FetcherManager manage and control the fetcher
| 104 | |
| 105 | // FetcherManager manage and control the fetcher |
| 106 | type FetcherManager interface { |
| 107 | // Name return the name of the protocol. |
| 108 | Name() string |
| 109 | // Filters registers the supported schemes. |
| 110 | Filters() []*SchemeFilter |
| 111 | // Build returns a new fetcher. |
| 112 | Build() Fetcher |
| 113 | // ParseName name displayed when the task is not yet resolved, parsed from the request URL |
| 114 | ParseName(u string) string |
| 115 | // AutoRename returns whether the fetcher need renaming the download file when has the same name file. |
| 116 | AutoRename() bool |
| 117 | |
| 118 | // DefaultConfig returns the default configuration of the protocol. |
| 119 | DefaultConfig() any |
| 120 | // Store fetcher |
| 121 | Store(fetcher Fetcher) (any, error) |
| 122 | // Restore fetcher |
| 123 | Restore() (v any, f func(meta *FetcherMeta, v any) Fetcher) |
| 124 | // Close the fetcher manager, release resources. |
| 125 | Close() error |
| 126 | } |
| 127 | |
| 128 | type DefaultFetcher struct { |
| 129 | Ctl *controller.Controller |
no outgoing calls
no test coverage detected