Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit a21b06e

Browse files
committed
abstract Conn Stat interface for threading
1 parent ac2ecf3 commit a21b06e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

network/conn.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type Conn interface {
1919

2020
ConnSecurity
2121
ConnMultiaddrs
22+
ConnStat
2223

2324
// ID returns an identifier that uniquely identifies this Conn within this
2425
// host, during this run. Connection IDs may repeat across restarts.
@@ -29,9 +30,6 @@ type Conn interface {
2930

3031
// GetStreams returns all open streams over this conn.
3132
GetStreams() []Stream
32-
33-
// Stat stores metadata pertaining to this conn.
34-
Stat() Stat
3533
}
3634

3735
// ConnSecurity is the interface that one can mix into a connection interface to
@@ -61,3 +59,8 @@ type ConnMultiaddrs interface {
6159
// with this connection
6260
RemoteMultiaddr() ma.Multiaddr
6361
}
62+
63+
type ConnStat interface {
64+
// Stat stores metadata pertaining to this conn.
65+
Stat() Stat
66+
}

0 commit comments

Comments
 (0)