mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2025-03-31 13:30:06 +08:00
network: add Opened timestamp to network.Stat.
This commit is contained in:
parent
c109bc7f90
commit
7513ae8da7
@ -8,6 +8,7 @@ package network
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/jbenet/goprocess"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
@ -55,8 +56,12 @@ const (
|
||||
|
||||
// Stat stores metadata pertaining to a given Stream/Conn.
|
||||
type Stat struct {
|
||||
// Direction specifies whether this is an inbound or an outbound connection.
|
||||
Direction Direction
|
||||
Extra map[interface{}]interface{}
|
||||
// Opened is the timestamp when this connection was opened.
|
||||
Opened time.Time
|
||||
// Extra stores additional metadata about this connection.
|
||||
Extra map[interface{}]interface{}
|
||||
}
|
||||
|
||||
// StreamHandler is the type of function used to listen for
|
||||
|
Loading…
Reference in New Issue
Block a user