mirror of
https://github.com/foomo/keel.git
synced 2025-10-16 12:35:34 +00:00
30 lines
665 B
Go
30 lines
665 B
Go
package keel
|
|
|
|
import (
|
|
"github.com/foomo/keel/interfaces"
|
|
)
|
|
|
|
func IsCloser(v any) bool {
|
|
switch v.(type) {
|
|
case interfaces.Closer,
|
|
interfaces.ErrorCloser,
|
|
interfaces.CloserWithContext,
|
|
interfaces.ErrorCloserWithContext,
|
|
interfaces.Shutdowner,
|
|
interfaces.ErrorShutdowner,
|
|
interfaces.ShutdownerWithContext,
|
|
interfaces.ErrorShutdownerWithContext,
|
|
interfaces.Stopper,
|
|
interfaces.ErrorStopper,
|
|
interfaces.StopperWithContext,
|
|
interfaces.ErrorStopperWithContext,
|
|
interfaces.Unsubscriber,
|
|
interfaces.ErrorUnsubscriber,
|
|
interfaces.UnsubscriberWithContext,
|
|
interfaces.ErrorUnsubscriberWithContext:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|