Documentation
¶
Overview ¶
Package closer offers a simple thread-safe closer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Closer ¶
type Closer interface {
// Close in a thread-safe manner. implements the io.Closer interface.
// This method returns always the close error, regardless of how often
// this method is called. Close blocks until all close functions are done,
// no matter which goroutine called this method.
// Returns a hashicorp multierror.
Close() error
// CloseChan channel which is closed as
// soon as the closer is closed.
CloseChan() <-chan struct{}
// CloserWaitGroup returns the wait group for this closer.
// Use this wait group to wait before calling the close functions.
CloserWaitGroup() *sync.WaitGroup
// IsClosed returns a boolean indicating
// if this instance was closed.
IsClosed() bool
// Calls the close function on close.
// Errors are appended to the Close() multi error.
// Close functions are called in LIFO order.
OnClose(f CloseFunc)
}
A Closer is a thread-safe helper for common close actions.
Click to show internal directories.
Click to hide internal directories.