Documentation
¶
Overview ¶
Package server implements the local HTTP API consumed by the embedded dashboard. It binds to 127.0.0.1 only and serves the contract defined in api/openapi.yaml. See docs/superpowers/plans (plan P2) for the implementation plan.
Package server implements the local HTTP API consumed by the embedded dashboard.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DaemonStatusProvider ¶
type DaemonStatusProvider interface {
Status(ctx context.Context) (contracts.DaemonStatus, error)
}
DaemonStatusProvider reports the current daemon runtime status.
type Deps ¶
type Deps struct {
Store contracts.Store
Pricing contracts.PricingTable
Profiles ProfileLister
WebRoot http.FileSystem
Daemon DaemonStatusProvider
Hooks HookStatusProvider
Headroom HeadroomEvaluator
Ingestor HeadroomIngestor
Quota QuotaProvider
// Recommendations streams pressure-driven profile recommendation events.
Recommendations RecommendationsSource
}
Deps is the set of dependencies the server needs.
type HeadroomEvaluator ¶
type HeadroomEvaluator interface {
Evaluate(ctx context.Context, profiles []contracts.Profile, opts headroom.Options) (headroom.Result, error)
}
HeadroomEvaluator evaluates profile headroom candidates.
type HeadroomIngestor ¶
type HeadroomIngestor interface {
IngestHeadroomProfiles(ctx context.Context, profiles []contracts.Profile) (map[string]string, error)
}
HeadroomIngestor best-effort ingests profiles before headroom evaluation.
type HookStatusProvider ¶
type HookStatusProvider interface {
Status(ctx context.Context, opts hooks.StatusOptions) ([]hooks.Result, error)
}
HookStatusProvider reports hook installation status.
type ProfileLister ¶
ProfileLister exposes the subset of the profile manager the server needs.
type QuotaProvider ¶
type QuotaProvider interface {
Quota(ctx context.Context, profileFilter string) ([]contracts.ProfileQuota, error)
}
QuotaProvider returns per-profile plan-aware quota windows. profileFilter is the value of the profile query parameter; empty means all profiles.
type RecommendationsSource ¶
type RecommendationsSource interface {
Subscribe(ctx context.Context) <-chan contracts.RecommendationEvent
}
RecommendationsSource provides per-request RecommendationEvent subscriptions.