Documentation ¶
Index ¶
- Constants
- func Boot() *boot
- type BoltStorage
- func (b *BoltStorage) Clear() error
- func (b *BoltStorage) Close() error
- func (b *BoltStorage) Delete(bucket string, key string) error
- func (b *BoltStorage) Get(bucket string, key string, v any) (bool, error)
- func (b *BoltStorage) List(bucket string, v any) error
- func (b *BoltStorage) Pop(bucket string, key string, v any) error
- func (b *BoltStorage) Put(bucket string, key string, v any) error
- func (b *BoltStorage) Setup(buckets []string) error
- type Downloader
- func (d *Downloader) Clear() error
- func (d *Downloader) Close() error
- func (d *Downloader) Continue(id string) (err error)
- func (d *Downloader) ContinueAll() (err error)
- func (d *Downloader) Create(rrId string, opts *base.Options) (taskId string, err error)
- func (d *Downloader) CreateDirect(req *base.Request, opts *base.Options) (taskId string, err error)
- func (d *Downloader) Delete(id string, force bool) (err error)
- func (d *Downloader) GetConfig() (*DownloaderStoreConfig, error)
- func (d *Downloader) GetTask(id string) *Task
- func (d *Downloader) GetTasks() []*Task
- func (d *Downloader) Listener(fn Listener)
- func (d *Downloader) Pause(id string) (err error)
- func (d *Downloader) PauseAll() (err error)
- func (d *Downloader) PutConfig(v *DownloaderStoreConfig) error
- func (d *Downloader) Resolve(req *base.Request) (rr *ResolveResult, err error)
- func (d *Downloader) Setup() error
- type DownloaderConfig
- type DownloaderStoreConfig
- type Event
- type EventKey
- type Listener
- type MemStorage
- func (n *MemStorage) Clear() error
- func (n *MemStorage) Close() error
- func (n *MemStorage) Delete(bucket string, key string) error
- func (n *MemStorage) Get(bucket string, key string, v any) (bool, error)
- func (n *MemStorage) List(bucket string, v any) error
- func (n *MemStorage) Pop(bucket string, key string, v any) error
- func (n *MemStorage) Put(bucket string, key string, v any) error
- func (n *MemStorage) Setup(buckets []string) error
- type Progress
- type ResolveResult
- type Storage
- type Task
Constants ¶
View Source
const ( EventKeyStart = "start" EventKeyPause = "pause" EventKeyContinue = "continue" EventKeyProgress = "progress" EventKeyError = "error" EventKeyDelete = "delete" EventKeyDone = "done" EventKeyFinally = "finally" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoltStorage ¶
type BoltStorage struct {
// contains filtered or unexported fields
}
func NewBoltStorage ¶
func NewBoltStorage(dir string) *BoltStorage
func (*BoltStorage) Clear ¶
func (b *BoltStorage) Clear() error
func (*BoltStorage) Close ¶
func (b *BoltStorage) Close() error
func (*BoltStorage) Setup ¶
func (b *BoltStorage) Setup(buckets []string) error
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
func NewDownloader ¶
func NewDownloader(cfg *DownloaderConfig) *Downloader
func (*Downloader) Clear ¶
func (d *Downloader) Clear() error
func (*Downloader) Close ¶
func (d *Downloader) Close() error
func (*Downloader) Continue ¶
func (d *Downloader) Continue(id string) (err error)
func (*Downloader) ContinueAll ¶ added in v1.3.2
func (d *Downloader) ContinueAll() (err error)
func (*Downloader) CreateDirect ¶ added in v1.3.1
func (*Downloader) GetConfig ¶
func (d *Downloader) GetConfig() (*DownloaderStoreConfig, error)
func (*Downloader) GetTask ¶
func (d *Downloader) GetTask(id string) *Task
func (*Downloader) GetTasks ¶
func (d *Downloader) GetTasks() []*Task
func (*Downloader) Listener ¶
func (d *Downloader) Listener(fn Listener)
func (*Downloader) Pause ¶
func (d *Downloader) Pause(id string) (err error)
func (*Downloader) PauseAll ¶ added in v1.3.2
func (d *Downloader) PauseAll() (err error)
func (*Downloader) PutConfig ¶
func (d *Downloader) PutConfig(v *DownloaderStoreConfig) error
func (*Downloader) Resolve ¶
func (d *Downloader) Resolve(req *base.Request) (rr *ResolveResult, err error)
func (*Downloader) Setup ¶
func (d *Downloader) Setup() error
type DownloaderConfig ¶
type DownloaderConfig struct { Controller *controller.Controller FetchBuilders []fetcher.FetcherBuilder RefreshInterval int `json:"refreshInterval"` // RefreshInterval time duration to refresh task progress(ms) Storage Storage StorageDir string *DownloaderStoreConfig }
func (*DownloaderConfig) Init ¶
func (cfg *DownloaderConfig) Init() *DownloaderConfig
type DownloaderStoreConfig ¶
type DownloaderStoreConfig struct { FirstLoad bool `json:"-"` // fromNoStore is the flag that the config is first time init and not from store DownloadDir string `json:"downloadDir"` // DownloadDir is the default directory to save the downloaded files MaxRunning int `json:"maxRunning"` // MaxRunning is the max running download count ProtocolConfig map[string]any `json:"protocolConfig"` // ProtocolConfig is special config for each protocol Extra map[string]any `json:"extra"` // Extra is the extra config }
DownloaderStoreConfig is the config that can restore the downloader.
func (*DownloaderStoreConfig) Init ¶ added in v1.3.1
func (cfg *DownloaderStoreConfig) Init() *DownloaderStoreConfig
type MemStorage ¶
type MemStorage struct { }
func NewMemStorage ¶
func NewMemStorage() *MemStorage
func (*MemStorage) Clear ¶
func (n *MemStorage) Clear() error
func (*MemStorage) Close ¶
func (n *MemStorage) Close() error
func (*MemStorage) Setup ¶
func (n *MemStorage) Setup(buckets []string) error
type ResolveResult ¶
Click to show internal directories.
Click to hide internal directories.