Documentation
¶
Index ¶
Constants ¶
View Source
const ( None = shared.None Started = shared.Started Stopped = shared.Stopped Completed = shared.Completed )
View Source
const DefaultTrackerAnnounceTimeout = 15 * time.Second
The code *is* the documentation.
Variables ¶
View Source
var ErrBadScheme = errors.New("unknown scheme")
Functions ¶
This section is empty.
Types ¶
type Announce ¶
type Announce struct {
TrackerUrl string
Request AnnounceRequest
HostHeader string
HttpProxy func(*http.Request) (*url.URL, error)
HttpRequestDirector func(*http.Request) error
DialContext func(ctx context.Context, network, addr string) (net.Conn, error)
ListenPacket func(network, addr string) (net.PacketConn, error)
ServerName string
UserAgent string
UdpNetwork string
// If the port is zero, it's assumed to be the same as the Request.Port.
ClientIp4 krpc.NodeAddr
// If the port is zero, it's assumed to be the same as the Request.Port.
ClientIp6 krpc.NodeAddr
Context context.Context
Logger log.Logger
}
func (Announce) Do ¶
func (me Announce) Do() (res AnnounceResponse, err error)
type AnnounceEvent ¶
type AnnounceEvent = udp.AnnounceEvent
type AnnounceOpt ¶
type AnnounceOpt = trHttp.AnnounceOpt
type AnnounceRequest ¶
type AnnounceRequest = udp.AnnounceRequest
type AnnounceResponse ¶
type AnnounceResponse = trHttp.AnnounceResponse
type Client ¶
type Client interface {
Announce(context.Context, AnnounceRequest, AnnounceOpt) (AnnounceResponse, error)
Scrape(ctx context.Context, ihs []infohash.T) (out udp.ScrapeResponse, err error)
Close() error
}
type NewClientOpts ¶
type NewClientOpts struct {
Http trHttp.NewClientOpts
// Overrides the network in the scheme. Probably a legacy thing.
UdpNetwork string
Logger log.Logger
ListenPacket func(network, addr string) (net.PacketConn, error)
}
Click to show internal directories.
Click to hide internal directories.