effusion v0.2.0 Effusion.BTP.Peer View Source

Functions for manipulating a member of a BitTorrent swarm.

Link to this section Summary

Link to this section Functions

Link to this function

changeset(peer, params \\ %{})

View Source
Link to this function

connected?(peer, info_hash)

View Source
Link to this function

connected_query(info_hash)

View Source
Link to this macro

is_peer_id(term)

View Source (macro)

Returns true if term is a 20-byte binary peer ID; false otherwise.

Allowed in guard tests.

Examples

iex> Effusion.BTP.Peer.is_peer_id("12345678901234567890")
true

iex> Effusion.BTP.Peer.is_peer_id("1234567890")
false
Link to this function

new(address, peer_id \\ nil)

View Source

Create a new peer data structure.