25 lines
428 B
Go
25 lines
428 B
Go
package ifconnmgr
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
inet "github.com/libp2p/go-libp2p-net"
|
|
peer "github.com/libp2p/go-libp2p-peer"
|
|
)
|
|
|
|
type ConnManager interface {
|
|
TagPeer(peer.ID, string, int)
|
|
UntagPeer(peer.ID, string)
|
|
GetTagInfo(peer.ID) *TagInfo
|
|
TrimOpenConns(context.Context)
|
|
Notifee() inet.Notifiee
|
|
}
|
|
|
|
type TagInfo struct {
|
|
FirstSeen time.Time
|
|
Value int
|
|
Tags map[string]int
|
|
Conns map[string]time.Time
|
|
}
|