Documentation ¶
Index ¶
- func MessagePeer(peer *peer.PeerState)
- func Start(path string, options ...func(*conf.Flags))
- type ActivePiece
- type ExtensionHandshake
- type MetadataMessage
- type TorrentSession
- func (ts *TorrentSession) AcceptNewPeer(btconn *listen.BtConn)
- func (ts *TorrentSession) AddPeer(btconn *listen.BtConn)
- func (ts *TorrentSession) ChoosePiece(p *peer.PeerState) (piece int)
- func (ts *TorrentSession) ClosePeer(peer *peer.PeerState)
- func (ts *TorrentSession) DoExtension(msg []byte, p *peer.PeerState) (err error)
- func (ts *TorrentSession) DoMessage(p *peer.PeerState, message []byte) (err error)
- func (ts *TorrentSession) DoMetadata(msg []byte, p *peer.PeerState)
- func (ts *TorrentSession) DoTorrent()
- func (ts *TorrentSession) Header() (header []byte)
- func (ts *TorrentSession) HintNewPeer(peer string)
- func (ts *TorrentSession) Quit() (err error)
- func (ts *TorrentSession) RecordBlock(p *peer.PeerState, piece, begin, length uint32) (err error)
- func (ts *TorrentSession) RequestBlock(p *peer.PeerState) error
- func (ts *TorrentSession) RequestBlock2(p *peer.PeerState, piece int, endGame bool) (err error)
- func (ts *TorrentSession) Shutdown() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MessagePeer ¶
Types ¶
type ActivePiece ¶
type ActivePiece struct {
// contains filtered or unexported fields
}
type ExtensionHandshake ¶
type MetadataMessage ¶
type TorrentSession ¶
type TorrentSession struct { M *meta.MetaInfo Session meta.SessionInfo // contains filtered or unexported fields }
func NewTorrentSession ¶
func (*TorrentSession) AcceptNewPeer ¶
func (ts *TorrentSession) AcceptNewPeer(btconn *listen.BtConn)
func (*TorrentSession) AddPeer ¶
func (ts *TorrentSession) AddPeer(btconn *listen.BtConn)
Can be called from any goroutine
func (*TorrentSession) ChoosePiece ¶
func (ts *TorrentSession) ChoosePiece(p *peer.PeerState) (piece int)
func (*TorrentSession) ClosePeer ¶
func (ts *TorrentSession) ClosePeer(peer *peer.PeerState)
func (*TorrentSession) DoExtension ¶
func (ts *TorrentSession) DoExtension(msg []byte, p *peer.PeerState) (err error)
func (*TorrentSession) DoMessage ¶
func (ts *TorrentSession) DoMessage(p *peer.PeerState, message []byte) (err error)
func (*TorrentSession) DoMetadata ¶
func (ts *TorrentSession) DoMetadata(msg []byte, p *peer.PeerState)
func (*TorrentSession) DoTorrent ¶
func (ts *TorrentSession) DoTorrent()
func (*TorrentSession) Header ¶
func (ts *TorrentSession) Header() (header []byte)
func (*TorrentSession) HintNewPeer ¶
func (ts *TorrentSession) HintNewPeer(peer string)
Try to connect if the peer is not already in our peers. Can be called from any goroutine.
func (*TorrentSession) Quit ¶
func (ts *TorrentSession) Quit() (err error)
func (*TorrentSession) RecordBlock ¶
func (ts *TorrentSession) RecordBlock(p *peer.PeerState, piece, begin, length uint32) (err error)
func (*TorrentSession) RequestBlock ¶
func (ts *TorrentSession) RequestBlock(p *peer.PeerState) error
func (*TorrentSession) RequestBlock2 ¶
func (*TorrentSession) Shutdown ¶
func (ts *TorrentSession) Shutdown() (err error)
Click to show internal directories.
Click to hide internal directories.