Documentation ¶ Index ¶ type Closer func NewCloser() *Closer func (c *Closer) Add(closeFn func()) func (c *Closer) CloseAll() Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Closer ¶ type Closer struct { // contains filtered or unexported fields } func NewCloser ¶ func NewCloser() *Closer func (*Closer) Add ¶ func (c *Closer) Add(closeFn func()) Add adds a function to call during call to CloseAll. func (*Closer) CloseAll ¶ func (c *Closer) CloseAll() CloseAll calls all close functions in reverse order. Higher level-components should be closed first, but are usually instantiated last (and, thus, added later to the closer), hence the reverse order. Source Files ¶ View all Source files closer.go Click to show internal directories. Click to hide internal directories.