mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-13 16:23:33 -07:00
Merge pull request #370 from mrd0ll4r/hook-stopper
middleware: document stop.Stopper behaviour for Hooks
This commit is contained in:
@@ -9,6 +9,9 @@ import (
|
||||
|
||||
// Hook abstracts the concept of anything that needs to interact with a
|
||||
// BitTorrent client's request and response to a BitTorrent tracker.
|
||||
// PreHooks and PostHooks both use the same interface.
|
||||
//
|
||||
// A Hook can implement stop.Stopper if clean shutdown is required.
|
||||
type Hook interface {
|
||||
HandleAnnounce(context.Context, *bittorrent.AnnounceRequest, *bittorrent.AnnounceResponse) (context.Context, error)
|
||||
HandleScrape(context.Context, *bittorrent.ScrapeRequest, *bittorrent.ScrapeResponse) (context.Context, error)
|
||||
|
||||
Reference in New Issue
Block a user