stats

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	ConnectedCount func() int
}

func (*Handler) Overview

func (h *Handler) Overview(c *app.Context, _ api.EmptyRequest) (OverviewResponse, error)

func (*Handler) Trend

func (h *Handler) Trend(c *app.Context, req TrendRequest) (TrendResponse, error)

type OverviewResponse

type OverviewResponse struct {
	// Admin-only fields (nil for normal users)
	Users           *int64 `json:"users,omitempty"`
	Channels        *int64 `json:"channels,omitempty"`
	Models          *int64 `json:"models,omitempty"`
	Agents          *int64 `json:"agents,omitempty"`
	ConnectedAgents *int   `json:"connected_agents,omitempty"`

	// Common fields
	Tokens    int64 `json:"tokens"`
	UsageLogs int64 `json:"usage_logs"`
	TotalCost int64 `json:"total_cost"`

	// User-only fields (nil for admin)
	Quota     *int64 `json:"quota,omitempty"`
	UsedQuota *int64 `json:"used_quota,omitempty"`
}

type TrendRequest

type TrendRequest struct {
	Days string `form:"days"`
}

type TrendResponse

type TrendResponse struct {
	Items []dao.TrendItem `json:"items"`
}

Jump to

Keyboard shortcuts

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