s/Server/Tracker

This commit is contained in:
Jimmy Zelinskie
2016-08-04 00:18:58 -04:00
parent dc25c8cab2
commit 0d054414ab
3 changed files with 67 additions and 66 deletions

View File

@@ -161,15 +161,16 @@ type ClientError string
// Error implements the error interface for ClientError.
func (c ClientError) Error() string { return string(c) }
// Server represents an implementation of the BitTorrent tracker protocol.
type Server interface {
// Tracker represents an implementation of the BitTorrent tracker protocol.
type Tracker interface {
ListenAndServe() error
Stop()
}
// ServerFuncs are the collection of protocol-agnostic functions used to handle
// requests in a Server.
type ServerFuncs struct {
// TrackerFuncs is the collection of callback functions provided to a Tracker
// to (1) generate a response from a parsed request, and (2) observe anything
// after the response has been delivered to the client.
type TrackerFuncs struct {
HandleAnnounce AnnounceHandler
HandleScrape ScrapeHandler
AfterAnnounce AnnounceCallback