Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: add interfaces for reading clientConn #1941

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading