Documentation
¶
Index ¶
- type Handler
- func (h *Handler) Get(c *app.Context, req RequestIDRequest) (models.APIRequestLog, error)
- func (h *Handler) GetTrace(c *app.Context, req RequestIDRequest) (models.APIRequestTrace, error)
- func (h *Handler) List(c *app.Context, req ListRequest) (api.PaginatedResponse[models.APIRequestLog], error)
- func (h *Handler) PortalGet(c *app.Context, req RequestIDRequest) (PortalLogResponse, error)
- func (h *Handler) PortalGetTrace(c *app.Context, req RequestIDRequest) (models.APIRequestTrace, error)
- func (h *Handler) PortalList(c *app.Context, req PortalListRequest) (api.PaginatedResponse[PortalLogResponse], error)
- type ListRequest
- type PortalListRequest
- type PortalLogResponse
- type RequestIDRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
App app.Application
}
func (*Handler) Get ¶
func (h *Handler) Get(c *app.Context, req RequestIDRequest) (models.APIRequestLog, error)
func (*Handler) GetTrace ¶
func (h *Handler) GetTrace(c *app.Context, req RequestIDRequest) (models.APIRequestTrace, error)
func (*Handler) List ¶
func (h *Handler) List(c *app.Context, req ListRequest) (api.PaginatedResponse[models.APIRequestLog], error)
func (*Handler) PortalGet ¶
func (h *Handler) PortalGet(c *app.Context, req RequestIDRequest) (PortalLogResponse, error)
func (*Handler) PortalGetTrace ¶
func (h *Handler) PortalGetTrace(c *app.Context, req RequestIDRequest) (models.APIRequestTrace, error)
func (*Handler) PortalList ¶
func (h *Handler) PortalList(c *app.Context, req PortalListRequest) (api.PaginatedResponse[PortalLogResponse], error)
type ListRequest ¶
type ListRequest struct {
api.PaginationQuery
listfilter.TimeWindowQuery
APIServiceID *uint `form:"api_service_id"`
APIRouteID *uint `form:"api_route_id"`
APIUpstreamID *uint `form:"api_upstream_id"`
TokenID string `form:"token_id"`
StatusCode string `form:"status_code"`
RequestID string `form:"request_id"`
}
type PortalListRequest ¶
type PortalListRequest struct {
api.PaginationQuery
listfilter.TimeWindowQuery
TokenID string `form:"token_id"`
StatusCode string `form:"status_code"`
RequestID string `form:"request_id"`
}
PortalListRequest only exposes filters that cannot select internal routing infrastructure. Portal handlers always add the authenticated user's ID.
type PortalLogResponse ¶
type PortalLogResponse struct {
ID uint `json:"id"`
RequestID string `json:"request_id"`
TokenID uint `json:"token_id"`
TokenName string `json:"token_name"`
APIServiceID uint `json:"api_service_id"`
APIServiceName string `json:"api_service_name"`
APIRouteID uint `json:"api_route_id"`
APIRouteName string `json:"api_route_name"`
Protocol models.APIProtocol `json:"protocol"`
Method string `json:"method"`
Subpath string `json:"subpath"`
StatusCode int `json:"status_code"`
DurationMs int `json:"duration_ms"`
FirstByteMs int `json:"first_byte_ms"`
RequestBytes int64 `json:"request_bytes"`
ResponseBytes int64 `json:"response_bytes"`
WebSocketCloseCode *int `json:"websocket_close_code"`
QuotaGateDecision string `json:"quota_gate_decision"`
ErrorStage string `json:"error_stage"`
ErrorCode string `json:"error_code"`
RateLimitDecision string `json:"rate_limit_decision"`
RateLimitWaitMs int `json:"rate_limit_wait_ms"`
UnitPrice int64 `json:"unit_price"`
TotalCost int64 `json:"total_cost"`
CreatedAt int64 `json:"created_at"`
}
PortalLogResponse is the ordinary-user projection of an API request log. Internal upstream and Agent routing facts are intentionally absent.
type RequestIDRequest ¶
type RequestIDRequest struct {
RequestID string `uri:"request_id" form:"request_id" binding:"required"`
}
Click to show internal directories.
Click to hide internal directories.