feat: idle sleep for proxmox LXCs

This commit is contained in:
yusing
2025-04-16 12:08:46 +08:00
parent 7e56fce4c9
commit 3b4deccd8e
35 changed files with 1553 additions and 609 deletions

View File

@@ -36,8 +36,8 @@ const (
ActionForceReload
actionContainerWakeMask = ActionContainerCreate | ActionContainerStart | ActionContainerUnpause
actionContainerSleepMask = ActionContainerKill | ActionContainerStop | ActionContainerPause | ActionContainerDie
actionContainerStartMask = ActionContainerCreate | ActionContainerStart | ActionContainerUnpause
actionContainerStopMask = ActionContainerKill | ActionContainerStop | ActionContainerDie
)
const (
@@ -83,10 +83,14 @@ func (a Action) String() string {
return actionNameMap[a]
}
func (a Action) IsContainerWake() bool {
return a&actionContainerWakeMask != 0
func (a Action) IsContainerStart() bool {
return a&actionContainerStartMask != 0
}
func (a Action) IsContainerSleep() bool {
return a&actionContainerSleepMask != 0
func (a Action) IsContainerStop() bool {
return a&actionContainerStopMask != 0
}
func (a Action) IsContainerPause() bool {
return a == ActionContainerPause
}