httptracker

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPTracker

type HTTPTracker struct {
	// contains filtered or unexported fields
}

HTTPTracker is a torrent tracker that talks HTTP.

func New

func New(rawURL string, u *url.URL, timeout time.Duration, t *http.Transport, userAgent string, maxResponseLength int64) *HTTPTracker

New returns a new HTTPTracker.

func (*HTTPTracker) Announce

Announce the torrent by doing a GET request to the tracker.

func (*HTTPTracker) URL

func (t *HTTPTracker) URL() string

URL returns the URL string of the tracker.

type StatusError

type StatusError struct {
	Code   int
	Header http.Header
	Body   string
}

StatusError is returned from HTTP tracker announces when the response code is not 200 OK.

func (*StatusError) Error

func (e *StatusError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL