Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SystemHandler ¶
type SystemHandler struct {
*common.BaseHandler
// contains filtered or unexported fields
}
SystemHandler handles system-level commands like restart, reboot, shutdown, upgrade
func NewSystemHandler ¶
func NewSystemHandler(cmdExecutor common.CommandExecutor, wsClient common.WSClient, ctxManager *agent.ContextManager, pool *pool.Pool, versionResolver common.VersionResolver, apiSession common.APISession) *SystemHandler
NewSystemHandler creates a new system handler. versionResolver must not be nil; pass utils.NewDefaultVersionResolver() for production. apiSession may be nil in tests; byebye will skip the server-side unregister call when absent.
func (*SystemHandler) Execute ¶
func (h *SystemHandler) Execute(ctx context.Context, cmd string, args *common.CommandArgs) (int, string, error)
Execute runs the system command
func (*SystemHandler) Validate ¶
func (h *SystemHandler) Validate(cmd string, args *common.CommandArgs) error
Validate checks if the arguments are valid for the command
Click to show internal directories.
Click to hide internal directories.