Documentation
¶
Index ¶
- func AddChannel(c *gin.Context)
- func AddGroup(c *gin.Context)
- func AddToken(c *gin.Context)
- func AutomaticallyTestChannels(frequency int)
- func AutomaticallyUpdateChannels(frequency int)
- func CreateMetadata(g *gin.Context)
- func CreateUser(c *gin.Context)
- func DashboardListModels(c *gin.Context)
- func DeleteChannel(c *gin.Context)
- func DeleteDisabledChannel(c *gin.Context)
- func DeleteGroup(c *gin.Context)
- func DeleteMetadata(g *gin.Context)
- func DeleteToken(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func FetchChannelModels(c *gin.Context)
- func GenerateAccessToken(c *gin.Context)
- func GetAllActiveLogs(c *gin.Context)
- func GetAllChannels(c *gin.Context)
- func GetAllLogs(c *gin.Context)
- func GetAllMetadata(g *gin.Context)
- func GetAllTokens(c *gin.Context)
- func GetAllUsers(c *gin.Context)
- func GetAuthHeader(token string) http.Header
- func GetChannel(c *gin.Context)
- func GetChannelDescriptors(c *gin.Context)
- func GetGroup(c *gin.Context)
- func GetGroupList(c *gin.Context)
- func GetGroups(c *gin.Context)
- func GetLogDetail(c *gin.Context)
- func GetLogsSelfStat(c *gin.Context)
- func GetLogsStat(c *gin.Context)
- func GetMetadata(g *gin.Context)
- func GetOptions(c *gin.Context)
- func GetResponseBody(method, url string, channel *model.Channel, headers http.Header) ([]byte, error)
- func GetSelf(c *gin.Context)
- func GetStatus(c *gin.Context)
- func GetSubscription(c *gin.Context)
- func GetToken(c *gin.Context)
- func GetTokenStatus(c *gin.Context)
- func GetUsage(c *gin.Context)
- func GetUser(c *gin.Context)
- func GetUserAvailableModels(c *gin.Context)
- func GetUserDashboard(c *gin.Context)
- func GetUserLogs(c *gin.Context)
- func HandleSSEOptions(c *gin.Context)
- func ListAllModels(c *gin.Context)
- func ListModels(c *gin.Context)
- func Login(c *gin.Context)
- func Logout(c *gin.Context)
- func ManageUser(c *gin.Context)
- func Relay(c *gin.Context)
- func RelayNotFound(c *gin.Context)
- func RelayNotImplemented(c *gin.Context)
- func ResetChannel(c *gin.Context)
- func RetrieveModel(c *gin.Context)
- func SearchAllLogs(c *gin.Context)
- func SearchChannels(c *gin.Context)
- func SearchTokens(c *gin.Context)
- func SearchUserLogs(c *gin.Context)
- func SearchUsers(c *gin.Context)
- func SetupLogin(user *model.User, c *gin.Context)
- func StreamActiveLogs(c *gin.Context)
- func TestChannel(c *gin.Context)
- func TestChannels(c *gin.Context)
- func UpdateAllChannelsBalance(c *gin.Context)
- func UpdateChannel(c *gin.Context)
- func UpdateChannelBalance(c *gin.Context)
- func UpdateGroup(c *gin.Context)
- func UpdateMetadata(g *gin.Context)
- func UpdateOption(c *gin.Context)
- func UpdateSelf(c *gin.Context)
- func UpdateToken(c *gin.Context)
- func UpdateUser(c *gin.Context)
- type AIProxyUserOverviewResponse
- type APGC2DGPTUsageResponse
- type API2GPTUsageResponse
- type DeepSeekUsageResponse
- type FetchModelsRequest
- type GroupRequest
- type LoginRequest
- type ManageRequest
- type OpenAICreditGrants
- type OpenAIModelPermission
- type OpenAIModels
- type OpenAISBUsageResponse
- type OpenAISubscriptionResponse
- type OpenAIUsageDailyCost
- type OpenAIUsageResponse
- type OpenRouterResponse
- type SiliconFlowUsageResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddChannel ¶
func AutomaticallyTestChannels ¶
func AutomaticallyTestChannels(frequency int)
func AutomaticallyUpdateChannels ¶
func AutomaticallyUpdateChannels(frequency int)
func CreateMetadata ¶
func CreateUser ¶
func DashboardListModels ¶
func DeleteChannel ¶
func DeleteDisabledChannel ¶
func DeleteGroup ¶ added in v1.0.1
func DeleteMetadata ¶
func DeleteToken ¶
func DeleteUser ¶
func FetchChannelModels ¶ added in v1.0.1
FetchChannelModels 从上游拉取模型列表。 编辑渠道时传 channel_id(后端从 DB 取 key);新增渠道时传 key。 base_url 优先用请求值,空则回退到 channeltype.ChannelBaseURLs。 先尝试 {base_url}/v1/models,若返回非 2xx 则回退到 {base_url}/models。
func GenerateAccessToken ¶
func GetAllActiveLogs ¶ added in v1.0.1
GetAllActiveLogs 获取当前所有活跃(在转发中)的请求
func GetAllChannels ¶
func GetAllLogs ¶
func GetAllMetadata ¶
func GetAllTokens ¶
func GetAllUsers ¶
func GetChannel ¶
func GetChannelDescriptors ¶ added in v1.0.1
GetChannelDescriptors 下发渠道能力清单(PRD §5.12 层1 / 决策 D7)。
前端启动 / 进入渠道页时拉取,据此渲染渠道类型下拉、列表标签与通用面板, 从而不在前端硬编码任何渠道类型(描述符驱动 + 通用渲染器)。
本仓不注册任何渠道 → 注册表为空 → 返回空列表;扩展渠道的清单由扩展方在其 init() 中注入。data 恒为数组(空时为 []),便于前端统一处理。
func GetGroupList ¶ added in v1.0.1
func GetLogDetail ¶
func GetLogsSelfStat ¶
func GetLogsStat ¶
func GetMetadata ¶
func GetOptions ¶
func GetResponseBody ¶
func GetSubscription ¶
func GetTokenStatus ¶
func GetUserAvailableModels ¶
func GetUserDashboard ¶
func GetUserLogs ¶
func HandleSSEOptions ¶ added in v1.0.1
HandleSSEOptions 处理 SSE 连接前的 OPTIONS preflight(CORS,不要求认证)
func ListAllModels ¶
func ListModels ¶
func RelayNotFound ¶
func RelayNotImplemented ¶
func ResetChannel ¶
func RetrieveModel ¶
func SearchAllLogs ¶
func SearchChannels ¶
func SearchTokens ¶
func SearchUserLogs ¶
func SearchUsers ¶
func SetupLogin ¶
setup session & cookies and then return user info
func StreamActiveLogs ¶ added in v1.0.1
StreamActiveLogs SSE 端点,实时推送活跃请求的增删改事件
func TestChannel ¶
func TestChannels ¶
func UpdateChannel ¶
func UpdateChannelBalance ¶
func UpdateGroup ¶ added in v1.0.1
func UpdateMetadata ¶
func UpdateOption ¶
func UpdateSelf ¶
func UpdateToken ¶
func UpdateUser ¶
Types ¶
type APGC2DGPTUsageResponse ¶
type API2GPTUsageResponse ¶
type DeepSeekUsageResponse ¶
type FetchModelsRequest ¶ added in v1.0.1
type GroupRequest ¶ added in v1.0.1
type LoginRequest ¶
type ManageRequest ¶
type OpenAICreditGrants ¶
type OpenAIModelPermission ¶
type OpenAIModelPermission struct {
Id string `json:"id"`
Object string `json:"object"`
Created int `json:"created"`
AllowCreateEngine bool `json:"allow_create_engine"`
AllowSampling bool `json:"allow_sampling"`
AllowLogprobs bool `json:"allow_logprobs"`
AllowSearchIndices bool `json:"allow_search_indices"`
AllowView bool `json:"allow_view"`
AllowFineTuning bool `json:"allow_fine_tuning"`
Organization string `json:"organization"`
Group *string `json:"group"`
IsBlocking bool `json:"is_blocking"`
}
type OpenAIModels ¶
type OpenAIModels struct {
Id string `json:"id"`
Object string `json:"object"`
Created int `json:"created"`
OwnedBy string `json:"owned_by"`
Permission []OpenAIModelPermission `json:"permission"`
Root string `json:"root"`
Parent *string `json:"parent"`
SupportedEndpointTypes []apitype.EndpointType `json:"supported_endpoint_types,omitempty"`
DisplayName string `json:"display_name,omitempty"`
Visibility string `json:"visibility,omitempty"`
SupportedInApi bool `json:"supported_in_api,omitempty"`
Priority int `json:"priority,omitempty"`
DefaultReasoningLevel string `json:"default_reasoning_level,omitempty"`
SupportedReasoningLevels []string `json:"supported_reasoning_levels,omitempty"`
ContextWindow int `json:"context_window,omitempty"`
TruncationPolicy string `json:"truncation_policy,omitempty"`
InputModalities []string `json:"input_modalities,omitempty"`
ApplyPatchToolType string `json:"apply_patch_tool_type,omitempty"`
WebSearchToolType string `json:"web_search_tool_type,omitempty"`
}
type OpenAISBUsageResponse ¶
type OpenAISubscriptionResponse ¶
type OpenAISubscriptionResponse struct {
Object string `json:"object"`
HasPaymentMethod bool `json:"has_payment_method"`
SoftLimitUSD float64 `json:"soft_limit_usd"`
HardLimitUSD float64 `json:"hard_limit_usd"`
SystemHardLimitUSD float64 `json:"system_hard_limit_usd"`
AccessUntil int64 `json:"access_until"`
}
type OpenAIUsageDailyCost ¶
type OpenAIUsageResponse ¶
type OpenRouterResponse ¶
type SiliconFlowUsageResponse ¶
type SiliconFlowUsageResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Status bool `json:"status"`
Data struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
Email string `json:"email"`
IsAdmin bool `json:"isAdmin"`
Balance string `json:"balance"`
Status string `json:"status"`
Introduction string `json:"introduction"`
Role string `json:"role"`
ChargeBalance string `json:"chargeBalance"`
TotalBalance string `json:"totalBalance"`
Category string `json:"category"`
} `json:"data"`
}