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: 0

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