Documentation ¶
Index ¶
- func NewWebsocketCaller(ctx context.Context, uri string, timeout time.Duration, notifier Notifier) (*websocketCaller, error)
- type DummyNotifier
- func (DummyNotifier) OnBtDownloadComplete(events []Event)
- func (DummyNotifier) OnDownloadComplete(events []Event)
- func (DummyNotifier) OnDownloadError(events []Event)
- func (DummyNotifier) OnDownloadPause(events []Event)
- func (DummyNotifier) OnDownloadStart(events []Event)
- func (DummyNotifier) OnDownloadStop(events []Event)
- type Event
- type Notifier
- type ResponseProcFn
- type ResponseProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DummyNotifier ¶
type DummyNotifier struct{}
func (DummyNotifier) OnBtDownloadComplete ¶
func (DummyNotifier) OnBtDownloadComplete(events []Event)
func (DummyNotifier) OnDownloadComplete ¶
func (DummyNotifier) OnDownloadComplete(events []Event)
func (DummyNotifier) OnDownloadError ¶
func (DummyNotifier) OnDownloadError(events []Event)
func (DummyNotifier) OnDownloadPause ¶
func (DummyNotifier) OnDownloadPause(events []Event)
func (DummyNotifier) OnDownloadStart ¶
func (DummyNotifier) OnDownloadStart(events []Event)
func (DummyNotifier) OnDownloadStop ¶
func (DummyNotifier) OnDownloadStop(events []Event)
type Notifier ¶
type Notifier interface { // OnDownloadStart will be sent when a download is started. OnDownloadStart([]Event) // OnDownloadPause will be sent when a download is paused. OnDownloadPause([]Event) // OnDownloadStop will be sent when a download is stopped by the user. OnDownloadStop([]Event) // OnDownloadComplete will be sent when a download is complete. For BitTorrent downloads, this notification is sent when the download is complete and seeding is over. OnDownloadComplete([]Event) // OnDownloadError will be sent when a download is stopped due to an error. OnDownloadError([]Event) // OnBtDownloadComplete will be sent when a torrent download is complete but seeding is still going on. OnBtDownloadComplete([]Event) }
Notifier handles rpc notification from aria2 server
type ResponseProcFn ¶
type ResponseProcFn func(resp rpc.ClientResponse) error
type ResponseProcessor ¶
type ResponseProcessor struct {
// contains filtered or unexported fields
}
func NewResponseProcessor ¶
func NewResponseProcessor() *ResponseProcessor
func (*ResponseProcessor) Add ¶
func (r *ResponseProcessor) Add(id uint64, fn ResponseProcFn)
func (*ResponseProcessor) Process ¶
func (r *ResponseProcessor) Process(resp rpc.ClientResponse) error
Process called by recv routine
Click to show internal directories.
Click to hide internal directories.