Documentation
¶
Overview ¶
Package closepool allows pooling io.Closer instances and closing them in a single operation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloserFunc ¶ added in v0.17.0
type CloserFunc func() error
CloserFunc allows to turn a suitable function into an io.Closer.
func (CloserFunc) Close ¶ added in v0.17.0
func (fx CloserFunc) Close() error
Close implements io.Closer.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool allows pooling a set of io.Closer.
The zero value is ready to use.
func (*Pool) Close ¶
Close closes all the io.Closer inside the pool iterating in backward order. Therefore, if one registers a TCP connection and then the corresponding TLS connection, the TLS connection is closed first. The returned error is the join of all the errors that occurred when closing connections.
Click to show internal directories.
Click to hide internal directories.