middleware: document stop.Stopper behaviour for Hooks
This commit is contained in:
parent
395e59aef3
commit
756a0f6316
1 changed files with 3 additions and 0 deletions
|
@ -9,6 +9,9 @@ import (
|
||||||
|
|
||||||
// Hook abstracts the concept of anything that needs to interact with a
|
// Hook abstracts the concept of anything that needs to interact with a
|
||||||
// BitTorrent client's request and response to a BitTorrent tracker.
|
// 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 {
|
type Hook interface {
|
||||||
HandleAnnounce(context.Context, *bittorrent.AnnounceRequest, *bittorrent.AnnounceResponse) (context.Context, error)
|
HandleAnnounce(context.Context, *bittorrent.AnnounceRequest, *bittorrent.AnnounceResponse) (context.Context, error)
|
||||||
HandleScrape(context.Context, *bittorrent.ScrapeRequest, *bittorrent.ScrapeResponse) (context.Context, error)
|
HandleScrape(context.Context, *bittorrent.ScrapeRequest, *bittorrent.ScrapeResponse) (context.Context, error)
|
||||||
|
|
Loading…
Reference in a new issue