Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Id ¶
type Id struct { Priv PrivKey Pub PubKey Psk PreSharedKey // This is automatically generated from Psk. It must be 20 bytes long Infohash []byte // contains filtered or unexported fields }
The ID structure represents all the information a peer needs to know to be able to participate in a swarm sharing a given directory.
IDs start from the highest privileged type: a peer handling such an ID has the ability to write content to the folder, along with reading and storing its content. Its human-intelligible value can be retrieved from WriteReadStoreID
When derived once, the new ID now has lost the ability to write, but can still read and store content. Its human-intelligible value can be retrieved from ReadStoreID.
When derived a second time, the new ID can only store content; it cannot read it (because the actual content is encrypted). The corresponding value is StoreID.
Finally, when derived a third time, we get a infohash like the Bittorrent ones, that is used to find peers.
func NewFromString ¶
type PreSharedKey ¶
type PreSharedKey [32]byte
type PrivKey ¶
type PrivKey [ed.PrivateKeySize]byte
type PubKey ¶
type PubKey [ed.PublicKeySize]byte