Documentation ¶
Overview ¶
Package http implements a BitTorrent tracker over the HTTP protocol as per BEP 3.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseHandler ¶
type ResponseHandler func(http.ResponseWriter, *http.Request, httprouter.Params) (int, error)
ResponseHandler is an HTTP handler that returns a status code.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an HTTP serving torrent tracker.
type Writer ¶
type Writer struct {
http.ResponseWriter
}
Writer implements the tracker.Writer interface for the HTTP protocol.
func (*Writer) WriteAnnounce ¶
func (w *Writer) WriteAnnounce(res *models.AnnounceResponse) error
WriteAnnounce writes a bencode dict representation of an AnnounceResponse.
func (*Writer) WriteError ¶
WriteError writes a bencode dict with a failure reason.
func (*Writer) WriteScrape ¶
func (w *Writer) WriteScrape(res *models.ScrapeResponse) error
WriteScrape writes a bencode dict representation of a ScrapeResponse.
Click to show internal directories.
Click to hide internal directories.