mirror of
https://github.com/kubereboot/kured.git
synced 2026-05-17 13:56:43 +00:00
Without this, you get an error about the lack of package comments. "package-comments: should have a package comment (revive)" Signed-off-by: Jean-Philippe Evrard <open-source@a.spamming.party>
22 lines
610 B
Go
22 lines
610 B
Go
// Package blockers provides interfaces and implementations for determining
|
|
// whether a system should be prevented to reboot.
|
|
// You can use that package if you fork Kured's main loop.
|
|
package blockers
|
|
|
|
// RebootBlocked checks that a single block Checker
|
|
// will block the reboot or not.
|
|
func RebootBlocked(blockers ...RebootBlocker) bool {
|
|
for _, blocker := range blockers {
|
|
if blocker.IsBlocked() {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// RebootBlocker interface should be implemented by types
|
|
// to know if their instantiations should block a reboot
|
|
type RebootBlocker interface {
|
|
IsBlocked() bool
|
|
}
|