2016-08-10 02:08:15 +02:00
|
|
|
package middleware
|
2016-08-03 09:11:52 +02:00
|
|
|
|
2016-08-05 07:47:04 +02:00
|
|
|
import (
|
2016-08-17 04:32:15 +02:00
|
|
|
"context"
|
2016-08-05 07:47:04 +02:00
|
|
|
|
2016-08-17 03:42:08 +02:00
|
|
|
"github.com/chihaya/chihaya/bittorrent"
|
2016-08-05 07:47:04 +02:00
|
|
|
)
|
2016-08-03 09:11:52 +02:00
|
|
|
|
|
|
|
// Hook abstracts the concept of anything that needs to interact with a
|
|
|
|
// BitTorrent client's request and response to a BitTorrent tracker.
|
|
|
|
type Hook interface {
|
2016-09-06 00:23:10 +02:00
|
|
|
HandleAnnounce(context.Context, *bittorrent.AnnounceRequest, *bittorrent.AnnounceResponse) (context.Context, error)
|
|
|
|
HandleScrape(context.Context, *bittorrent.ScrapeRequest, *bittorrent.ScrapeResponse) (context.Context, error)
|
2016-08-03 09:11:52 +02:00
|
|
|
}
|