Skip to content

Commit 195155e

Browse files
client: add interfaces for reading clientConn (#1941)
* client: add interfaces for reading clientConn * client: add docs
1 parent b1c2788 commit 195155e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

client.go

+15
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,21 @@ type clientConn struct {
921921
lastUseTime time.Time
922922
}
923923

924+
// CreatedTime returns net.Conn the client.
925+
func (cc *clientConn) Conn() net.Conn {
926+
return cc.c
927+
}
928+
929+
// CreatedTime returns time the client was created.
930+
func (cc *clientConn) CreatedTime() time.Time {
931+
return cc.createdTime
932+
}
933+
934+
// LastUseTime returns time the client was last used.
935+
func (cc *clientConn) LastUseTime() time.Time {
936+
return cc.lastUseTime
937+
}
938+
924939
var startTimeUnix = time.Now().Unix()
925940

926941
// LastUseTime returns time the client was last used.

0 commit comments

Comments
 (0)