handler

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithKubeconfigProvider

func WithKubeconfigProvider(p KubeconfigProvider) func(*DashboardHandler)

WithKubeconfigProvider injects a kubeconfig provider used to query live K8s Pods.

func WithPool

func WithPool(pool *pgxpool.Pool) func(*DashboardHandler)

WithPool injects a database pool for direct queries (cluster name lookups).

func WithStackRepo

func WithStackRepo(repo stackport.StackRepository) func(*DashboardHandler)

WithStackRepo injects the stack repository used to drive the deployed-apps view.

Types

type AlertHandler

type AlertHandler struct {
	// contains filtered or unexported fields
}

AlertHandler handles HTTP requests for alert rule and history operations.

func NewAlertHandler

func NewAlertHandler(
	createAlertRule *usecase.CreateAlertRule,
	getAlertRule *usecase.GetAlertRule,
	listAlertRules *usecase.ListAlertRules,
	updateAlertRule *usecase.UpdateAlertRule,
	deleteAlertRule *usecase.DeleteAlertRule,
	listAlerts *usecase.ListAlerts,
) *AlertHandler

NewAlertHandler constructs an AlertHandler.

func (*AlertHandler) CreateRule

func (h *AlertHandler) CreateRule(c echo.Context) error

CreateRule handles POST /api/v1/alerts/rules.

func (*AlertHandler) DeleteRule

func (h *AlertHandler) DeleteRule(c echo.Context) error

func (*AlertHandler) GetRule

func (h *AlertHandler) GetRule(c echo.Context) error

func (*AlertHandler) ListHistory

func (h *AlertHandler) ListHistory(c echo.Context) error

ListHistory handles GET /api/v1/alerts/history.

func (*AlertHandler) ListRules

func (h *AlertHandler) ListRules(c echo.Context) error

ListRules handles GET /api/v1/alerts/rules. Query params:

scope: "stack" | "cicd" — filters alert rules to the specified domain.
        TODO: pass scope to repository filter when scoped rules are implemented.

func (*AlertHandler) RegisterRoutes

func (h *AlertHandler) RegisterRoutes(g *echo.Group)

RegisterRoutes registers alert routes on the given Echo group.

func (*AlertHandler) UpdateRule

func (h *AlertHandler) UpdateRule(c echo.Context) error

type DashboardHandler

type DashboardHandler struct {
	// contains filtered or unexported fields
}

DashboardHandler handles HTTP requests for observability dashboard operations.

func NewDashboardHandler

func NewDashboardHandler(getDashboard *usecase.GetDashboard, opts ...func(*DashboardHandler)) *DashboardHandler

NewDashboardHandler constructs a DashboardHandler.

func (*DashboardHandler) GetDashboard

func (h *DashboardHandler) GetDashboard(c echo.Context) error

GetDashboard handles GET /api/v1/observability/dashboard

func (*DashboardHandler) GetDeployedApps

func (h *DashboardHandler) GetDeployedApps(c echo.Context) error

GetDeployedApps handles GET /api/v1/observability/deployed-apps. Each item is a stack: status/cluster/namespace plus the live pods running in that namespace.

func (*DashboardHandler) RegisterRoutes

func (h *DashboardHandler) RegisterRoutes(g *echo.Group)

RegisterRoutes registers dashboard routes on the given Echo group.

type KubeconfigProvider

type KubeconfigProvider interface {
	GetKubeconfig(ctx context.Context, clusterID string) ([]byte, error)
}

KubeconfigProvider returns the decrypted kubeconfig bytes for a cluster. Defined locally so the observability module isn't coupled to a specific provider impl.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL