1
0
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:
fumiama
2021-12-30 16:35:37 +08:00
parent 66c200b708
commit db5ac5787e
2 changed files with 10 additions and 6 deletions

View File

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