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 ¶
This section is empty.
Types ¶
type CancelFunc ¶
type CancelFunc func()
CancelFunc can be used to shut down context watchers. It is safe to call the cancel function multiple times.
func CloseConnOnDone ¶
func CloseConnOnDone(ctx context.Context, conn DeadlineCloser) CancelFunc
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. Calling this function does not guarantee that the connection has been closed. It is not safe to call the returned function multiple times at the same time.
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.