mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-28 14:50:26 +08:00
add link rep
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/fumiama/WireGold/gold/head"
|
||||
"github.com/fumiama/WireGold/helper"
|
||||
)
|
||||
|
||||
// Link 是本机到 peer 的连接抽象
|
||||
@@ -100,3 +101,11 @@ func (l *Link) Write(p *head.Packet, istransfer bool) (n int, err error) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (l *Link) String() (n string) {
|
||||
n = "default"
|
||||
if l.pubk != nil {
|
||||
n = helper.BytesToString(l.pubk[:24])
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user