2
0
mirror of synced 2025-02-23 22:28:11 +00:00
torrent/tracker/peer.go
2016-11-22 15:40:46 +11:00

12 lines
208 B
Go

package tracker
import (
"net"
)
func (p *Peer) fromDictInterface(d map[string]interface{}) {
p.IP = net.ParseIP(d["ip"].(string))
p.ID = []byte(d["peer id"].(string))
p.Port = int(d["port"].(int64))
}