utmd

package module
v0.0.0-...-edcc49b Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2016 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

utmd

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(addr string, tor []byte, cb func(down, total int)) (b []byte, err error)

Download metadata of torrent(tor infohash)

Types

type Peer

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

Peer has the metadata of torrent

func Handshake

func Handshake(addr string, tor []byte) (p *Peer, err error)

Handshake connection with addr and returns a peer

func (*Peer) Close

func (p *Peer) Close()

Close connection

func (*Peer) NumChunk

func (p *Peer) NumChunk() (n int)

NumChunk returns the number of chunk

func (*Peer) ReadChunk

func (p *Peer) ReadChunk(i int, b []byte) (n int, err error)

ReadChunk download chunk

func (*Peer) Size

func (p *Peer) Size() int

Size return metadata size

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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