Documentation ¶
Overview ¶
Package ctxconn provides a helper function to track context cancellation when working with connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseConnOnDone ¶
func CloseConnOnDone(ctx context.Context, conn DeadlineCloser) func() error
CloseConnOnDone closes conn whenever ctx is Done. This includes if ctx is canceled via its cancellation function.
Call the returned cancellation function to free up resources and closing the connection. The cancellation function returns any error from closing the connection.
Types ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_ctxconn is a generated GoMock package.
|
Package mock_ctxconn is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.