Skip to content

Commit

Permalink
client: add interfaces for reading clientConn (#1941)
Browse files Browse the repository at this point in the history
* client: add interfaces for reading clientConn

* client: add docs
  • Loading branch information
zhangyongding authored Jan 16, 2025
1 parent b1c2788 commit 195155e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,21 @@ type clientConn struct {
lastUseTime time.Time
}

// CreatedTime returns net.Conn the client.
func (cc *clientConn) Conn() net.Conn {
return cc.c
}

// CreatedTime returns time the client was created.
func (cc *clientConn) CreatedTime() time.Time {
return cc.createdTime
}

// LastUseTime returns time the client was last used.
func (cc *clientConn) LastUseTime() time.Time {
return cc.lastUseTime
}

var startTimeUnix = time.Now().Unix()

// LastUseTime returns time the client was last used.
Expand Down

0 comments on commit 195155e

Please sign in to comment.