handler

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 16 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.

type SecurityHandler added in v0.6.0

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

SecurityHandler 는 보안 대시보드 API 다(nullus-plan#65, 설계 §5.2).

권한별로 두 경로로 나눈다(결정 11) — 앱 축은 모든 역할, 설치 OSS 축은 admin · devops 만. /observability 그룹에는 역할 검사가 없어, 한 응답에 섞으면 핸들러가 필드를 지워야 하고 빠뜨리면 그대로 샌다.

func NewSecurityHandler added in v0.6.0

func NewSecurityHandler(apps appSecurityGetter, stacks stackSecurityGetter) *SecurityHandler

NewSecurityHandler 는 핸들러를 만든다.

func (*SecurityHandler) GetApps added in v0.6.0

func (h *SecurityHandler) GetApps(c echo.Context) error

GetApps handles GET /observability/security/apps?cluster_id=&stack_id=&q=&problem_only=.

조직은 로그인한 사용자(principal)의 것이다. summary · coverage · groups 는 범위 필터만 따르고 problem_only 는 따르지 않는다. apps 는 위험순 그대로다.

func (*SecurityHandler) GetStacks added in v0.6.0

func (h *SecurityHandler) GetStacks(c echo.Context) error

GetStacks handles GET /observability/security/stacks?cluster_id=&stack_id=. admin · devops 만 닿는다.

func (*SecurityHandler) RegisterRoutes added in v0.6.0

func (h *SecurityHandler) RegisterRoutes(g *echo.Group, stackGuards ...echo.MiddlewareFunc)

RegisterRoutes 는 /observability 그룹에 붙는다. stackGuards 는 설치 OSS 경로에만 붙는 역할 검사다(admin · devops). 관측 모듈은 인증 모듈을 알지 못하므로 배선하는 쪽이 넘긴다 — 지금 /stacks 를 쓸 수 없는 역할이 이 경로로 같은 숫자를 보면 안 된다.

type StackAlertHandler added in v0.6.0

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

StackAlertHandler 는 스택 심각 경보 목록이다(nullus-plan#87) — 알림 이력 화면이 쓴다.

func NewStackAlertHandler added in v0.6.0

func NewStackAlertHandler(list *usecase.ListStackAlerts) *StackAlertHandler

func (*StackAlertHandler) List added in v0.6.0

func (h *StackAlertHandler) List(c echo.Context) error

List 는 GET /observability/stack-alerts?state=open|all&limit= 다. 조직은 로그인한 사용자의 것이다.

func (*StackAlertHandler) RegisterRoutes added in v0.6.0

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

Jump to

Keyboard shortcuts

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