Discover Packages
github.com/osapi-io/osapi
internal
provider
node
power
package
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Oct 1, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package power provides power management operations (reboot, shutdown).
Darwin implements the Provider interface for Darwin (macOS).
All methods return ErrUnsupported as power management is not available on macOS.
func NewDarwinProvider() *Darwin
NewDarwinProvider factory to create a new Darwin instance.
Reboot returns ErrUnsupported on Darwin.
Shutdown returns ErrUnsupported on Darwin.
Debian implements the Provider interface for Debian-family systems.
NewDebianProvider factory to create a new Debian instance.
Reboot schedules a system reboot with the specified delay.
Shutdown schedules a system shutdown with the specified delay.
Linux implements the Provider interface for generic Linux.
All methods return ErrUnsupported as this is a generic Linux stub.
func NewLinuxProvider() *Linux
NewLinuxProvider factory to create a new Linux instance.
Reboot returns ErrUnsupported on generic Linux.
Shutdown returns ErrUnsupported on generic Linux.
type Opts struct {
Delay int `json:"delay,omitempty"`
Message string `json:"message,omitempty"`
}
Opts represents options for a power management operation.
Provider implements power management operations.
type Result struct {
Action string `json:"action"`
Delay int `json:"delay"`
Changed bool `json:"changed"`
Error string `json:"error,omitempty"`
}
Result represents the outcome of a power management operation.
Source Files
¶
Directories
¶
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.
Click to show internal directories.
Click to hide internal directories.