12 lignes
208 o
Go
12 lignes
208 o
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))
|
||
|
}
|