Extrahiere Deployments-, TaskRun- und WorkPool-Services in separate Dateien; entferne nicht benötigte Services und Funktionen.

This commit is contained in:
Gregor Schulte
2026-04-08 16:07:44 +02:00
parent 57531a7d95
commit 2dcc0b13dd
8 changed files with 652 additions and 600 deletions

30
pkg/client/admin.go Normal file
View File

@@ -0,0 +1,30 @@
package client
import (
"context"
"fmt"
)
// AdminService handles administrative operations.
type AdminService struct {
client *Client
}
// Health checks the health of the Prefect server.
func (a *AdminService) Health(ctx context.Context) error {
if err := a.client.get(ctx, "/health", nil); err != nil {
return fmt.Errorf("health check failed: %w", err)
}
return nil
}
// Version retrieves the server version.
func (a *AdminService) Version(ctx context.Context) (string, error) {
var result struct {
Version string `json:"version"`
}
if err := a.client.get(ctx, "/version", &result); err != nil {
return "", fmt.Errorf("failed to get version: %w", err)
}
return result.Version, nil
}