From 756a0f6316f1672c323a5460753f016fb4c87898 Mon Sep 17 00:00:00 2001 From: Leo Balduf Date: Sat, 2 Dec 2017 22:46:09 +0100 Subject: [PATCH] middleware: document stop.Stopper behaviour for Hooks --- middleware/hooks.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/middleware/hooks.go b/middleware/hooks.go index a77db86..4649f28 100644 --- a/middleware/hooks.go +++ b/middleware/hooks.go @@ -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)