api

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyUsage added in v0.9.11

type APIKeyUsage struct {
	Service UsageQuerier
}

func (*APIKeyUsage) Query added in v0.9.11

func (a *APIKeyUsage) Query(c *gin.Context)

Query returns the usage ranking only to the authenticated Root principal. @Tags DashboardAPI @Security ApiKeyAuth @Summary Query Root-only client API key usage ranking @Param time_range query string false "today, 1h, 6h, 24h, 7d" @Param sort_by query string false "tokens, request_count, cost" @Param limit query int false "10, 20, 50" @Success 200 {object} util.ResponseResult{data=schema.Response} @Failure 400,401,403,503 {object} util.ResponseResult @Router /api/v1/dashboard/api-key-ranking [get]

type Dashboard

type Dashboard struct {
	Monitor   *monitor.Reader
	RedisSync *resourcebiz.ConfigRedisSync
}

func (*Dashboard) HandleWebSocket

func (a *Dashboard) HandleWebSocket(c *gin.Context)

HandleWebSocket upgrades the HTTP request to WebSocket and pushes dashboard metrics

func (*Dashboard) QueryCircuitBreakers

func (a *Dashboard) QueryCircuitBreakers(c *gin.Context)

QueryCircuitBreakers reads currently isolated endpoints and services. @Tags DashboardAPI @Security ApiKeyAuth @Summary Read active circuit breakers @Success 200 {object} util.ResponseResult{data=[]monitor.CircuitBreakerInfo} @Failure 503 {object} util.ResponseResult @Router /api/v1/dashboard/circuit-breakers [get]

func (*Dashboard) QuerySnapshot added in v1.0.4

func (a *Dashboard) QuerySnapshot(c *gin.Context)

QuerySnapshot reads all selected results at one evaluation cutoff. @Tags DashboardAPI @Security ApiKeyAuth @Summary Read a monitoring snapshot with per-reading windows and coverage @Param query body monitor.Query true "Selected monitoring readings" @Success 200 {object} util.ResponseResult{data=monitor.Snapshot} @Failure 400 {object} util.ResponseResult @Router /api/v1/dashboard/snapshot [post]

func (*Dashboard) SyncRedis

func (a *Dashboard) SyncRedis(c *gin.Context)

type UsageQuerier added in v0.9.11

type UsageQuerier interface {
	Query(context.Context, schema.Query) (*schema.Response, error)
}

type UsageTrends added in v1.0.4

type UsageTrends struct {
	Service UsageTrendsQuerier
}

func (*UsageTrends) Query added in v1.0.4

func (a *UsageTrends) Query(c *gin.Context)

Query returns aggregate-only trends under the dashboard's normal RBAC permission. @Tags DashboardAPI @Security ApiKeyAuth @Summary Query request, token, latency and failure trends from request logs @Param time_range query string false "today, 1h, 6h, 24h, 7d" @Success 200 {object} util.ResponseResult{data=schema.UsageTrendsResponse} @Failure 400,401,403,503 {object} util.ResponseResult @Router /api/v1/dashboard/usage-trends [get]

type UsageTrendsQuerier added in v1.0.4

type UsageTrendsQuerier interface {
	Query(context.Context, schema.UsageTrendsQuery) (*schema.UsageTrendsResponse, error)
}

type WSConfigMsg

type WSConfigMsg struct {
	TrendsTimeRange       string `json:"trends_time_range"`
	TrendsGroupBy         string `json:"trends_group_by"`
	ModelRankingSortBy    string `json:"model_ranking_sort_by"`
	ModelRankingTimeRange string `json:"model_ranking_time_range"`
	Timezone              string `json:"timezone"`
}

WSConfigMsg represents the configuration parameters sent by the client

Jump to

Keyboard shortcuts

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