feat: add vm power actions

This commit is contained in:
Philipp
2026-06-11 11:29:29 +02:00
parent 262ec4f91b
commit d08e41b013
14 changed files with 541 additions and 16 deletions
+27
View File
@@ -0,0 +1,27 @@
package queue
import (
"context"
"encoding/json"
"forgejo.digital-droplets.de/philschlo/proxui/platform/jobs"
"github.com/hibiken/asynq"
)
type Enqueuer struct {
client *asynq.Client
}
func NewEnqueuer(client *asynq.Client) Enqueuer {
return Enqueuer{client: client}
}
func (e Enqueuer) EnqueueProxmoxTaskPoll(ctx context.Context, payload jobs.ProxmoxTaskPollPayload) error {
body, err := json.Marshal(payload)
if err != nil {
return err
}
_, err = e.client.EnqueueContext(ctx, asynq.NewTask(jobs.TypeProxmoxTaskPoll, body))
return err
}