FedP2P/tracker/peer.go

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))
}