From a21b06e646e5d86c32819da5f64efed56f87d997 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 4 Feb 2021 13:27:23 +0200 Subject: [PATCH] abstract Conn Stat interface for threading --- network/conn.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/network/conn.go b/network/conn.go index 25f0868..07afeac 100644 --- a/network/conn.go +++ b/network/conn.go @@ -19,6 +19,7 @@ type Conn interface { ConnSecurity ConnMultiaddrs + ConnStat // ID returns an identifier that uniquely identifies this Conn within this // host, during this run. Connection IDs may repeat across restarts. @@ -29,9 +30,6 @@ type Conn interface { // GetStreams returns all open streams over this conn. GetStreams() []Stream - - // Stat stores metadata pertaining to this conn. - Stat() Stat } // ConnSecurity is the interface that one can mix into a connection interface to @@ -61,3 +59,8 @@ type ConnMultiaddrs interface { // with this connection RemoteMultiaddr() ma.Multiaddr } + +type ConnStat interface { + // Stat stores metadata pertaining to this conn. + Stat() Stat +} -- GitLab