Documentation ¶ Index ¶ type CloseFunc type Closer func New(opts ...Option) *Closer func (c *Closer) Add(name string, fn CloseFunc) func (c *Closer) AddWrap(name string, fn func()) func (c *Closer) Close() error type Option func WithLogger(logger *slog.Logger) Option func WithTimeout(timeout time.Duration) Option Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type CloseFunc ¶ type CloseFunc func(ctx context.Context) error type Closer ¶ type Closer struct { // contains filtered or unexported fields } func New ¶ func New(opts ...Option) *Closer func (*Closer) Add ¶ func (c *Closer) Add(name string, fn CloseFunc) func (*Closer) AddWrap ¶ added in v0.0.3 func (c *Closer) AddWrap(name string, fn func()) func (*Closer) Close ¶ func (c *Closer) Close() error type Option ¶ added in v0.0.4 type Option func(*Closer) func WithLogger ¶ added in v0.0.4 func WithLogger(logger *slog.Logger) Option func WithTimeout ¶ added in v0.0.4 func WithTimeout(timeout time.Duration) Option Source Files ¶ View all Source files closer.gooptions.go Click to show internal directories. Click to hide internal directories.