server

package
v0.0.0-...-640c710 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnnounceURL = "/announce"

AnnounceURL The announce path for the http calls to reach.

View Source
var FIELDS = []string{"port", "uploaded", "downloaded", "left", "event", "compact"}

TODO(ian): Set this expireTime to a config-loaded value. expireTime := 5 * 60 FIELDS The fields that we expect from a peer upon info hash lookup

Functions

func CompactAllPeers

func CompactAllPeers(ipport []string) []byte

CompactAllPeers Comapcts all of the peers according to BEP 23

func EncodeResponse

func EncodeResponse(ipport []string, data *AnnounceData) (resp string)

EncodeResponse groups all of the peer-requested data into a nice bencoded string that we respond with.

func RunServer

func RunServer(rssNotifier *rss.RSSNotifier)

RunServer spins up the server and muxes the routes.

Types

type AnnounceResponse

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

AnnounceResponse models the response sent to peers

type AnnounceResponseFailure

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

AnnounceResponseFailure Models the failure response sent on tracker failures.

type TorrentResponseData

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

TorrentResponseData models what is sent back to the peer upon a succesful info hash lookup.

Jump to

Keyboard shortcuts

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