controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 36 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChannel

func AddChannel(c *gin.Context)

func AddToken

func AddToken(c *gin.Context)

func AutomaticallyTestChannels

func AutomaticallyTestChannels(frequency int)

func AutomaticallyUpdateChannels

func AutomaticallyUpdateChannels(frequency int)

func CreateMetadata

func CreateMetadata(g *gin.Context)

func CreateUser

func CreateUser(c *gin.Context)

func DashboardListModels

func DashboardListModels(c *gin.Context)

func DeleteChannel

func DeleteChannel(c *gin.Context)

func DeleteDisabledChannel

func DeleteDisabledChannel(c *gin.Context)

func DeleteMetadata

func DeleteMetadata(g *gin.Context)

func DeleteToken

func DeleteToken(c *gin.Context)

func DeleteUser

func DeleteUser(c *gin.Context)

func GenerateAccessToken

func GenerateAccessToken(c *gin.Context)

func GetAllChannels

func GetAllChannels(c *gin.Context)

func GetAllLogs

func GetAllLogs(c *gin.Context)

func GetAllMetadata

func GetAllMetadata(g *gin.Context)

func GetAllTokens

func GetAllTokens(c *gin.Context)

func GetAllUsers

func GetAllUsers(c *gin.Context)

func GetAuthHeader

func GetAuthHeader(token string) http.Header

GetAuthHeader get auth header

func GetChannel

func GetChannel(c *gin.Context)

func GetGroups

func GetGroups(c *gin.Context)

func GetLogDetail

func GetLogDetail(c *gin.Context)

func GetLogsSelfStat

func GetLogsSelfStat(c *gin.Context)

func GetLogsStat

func GetLogsStat(c *gin.Context)

func GetMetadata

func GetMetadata(g *gin.Context)

func GetOptions

func GetOptions(c *gin.Context)

func GetResponseBody

func GetResponseBody(method, url string, channel *model.Channel, headers http.Header) ([]byte, error)

func GetSelf

func GetSelf(c *gin.Context)

func GetStatus

func GetStatus(c *gin.Context)

func GetSubscription

func GetSubscription(c *gin.Context)

func GetToken

func GetToken(c *gin.Context)

func GetTokenStatus

func GetTokenStatus(c *gin.Context)

func GetUsage

func GetUsage(c *gin.Context)

func GetUser

func GetUser(c *gin.Context)

func GetUserAvailableModels

func GetUserAvailableModels(c *gin.Context)

func GetUserDashboard

func GetUserDashboard(c *gin.Context)

func GetUserLogs

func GetUserLogs(c *gin.Context)

func ListAllModels

func ListAllModels(c *gin.Context)

func ListModels

func ListModels(c *gin.Context)

func Login

func Login(c *gin.Context)

func Logout

func Logout(c *gin.Context)

func ManageUser

func ManageUser(c *gin.Context)

ManageUser Only admin user can do this

func Relay

func Relay(c *gin.Context)

func RelayNotFound

func RelayNotFound(c *gin.Context)

func RelayNotImplemented

func RelayNotImplemented(c *gin.Context)

func ResetChannel

func ResetChannel(c *gin.Context)

func RetrieveModel

func RetrieveModel(c *gin.Context)

func SearchAllLogs

func SearchAllLogs(c *gin.Context)

func SearchChannels

func SearchChannels(c *gin.Context)

func SearchTokens

func SearchTokens(c *gin.Context)

func SearchUserLogs

func SearchUserLogs(c *gin.Context)

func SearchUsers

func SearchUsers(c *gin.Context)

func SetupLogin

func SetupLogin(user *model.User, c *gin.Context)

setup session & cookies and then return user info

func TestChannel

func TestChannel(c *gin.Context)

func TestChannels

func TestChannels(c *gin.Context)

func UpdateAllChannelsBalance

func UpdateAllChannelsBalance(c *gin.Context)

func UpdateChannel

func UpdateChannel(c *gin.Context)

func UpdateChannelBalance

func UpdateChannelBalance(c *gin.Context)

func UpdateMetadata

func UpdateMetadata(g *gin.Context)

func UpdateOption

func UpdateOption(c *gin.Context)

func UpdateSelf

func UpdateSelf(c *gin.Context)

func UpdateToken

func UpdateToken(c *gin.Context)

func UpdateUser

func UpdateUser(c *gin.Context)

Types

type AIProxyUserOverviewResponse

type AIProxyUserOverviewResponse struct {
	Success   bool   `json:"success"`
	Message   string `json:"message"`
	ErrorCode int    `json:"error_code"`
	Data      struct {
		TotalPoints float64 `json:"totalPoints"`
	} `json:"data"`
}

type APGC2DGPTUsageResponse

type APGC2DGPTUsageResponse struct {
	//Grants         interface{} `json:"grants"`
	Object         string  `json:"object"`
	TotalAvailable float64 `json:"total_available"`
	TotalGranted   float64 `json:"total_granted"`
	TotalUsed      float64 `json:"total_used"`
}

type API2GPTUsageResponse

type API2GPTUsageResponse struct {
	Object         string  `json:"object"`
	TotalGranted   float64 `json:"total_granted"`
	TotalUsed      float64 `json:"total_used"`
	TotalRemaining float64 `json:"total_remaining"`
}

type DeepSeekUsageResponse

type DeepSeekUsageResponse struct {
	IsAvailable  bool `json:"is_available"`
	BalanceInfos []struct {
		Currency        string `json:"currency"`
		TotalBalance    string `json:"total_balance"`
		GrantedBalance  string `json:"granted_balance"`
		ToppedUpBalance string `json:"topped_up_balance"`
	} `json:"balance_infos"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type ManageRequest

type ManageRequest struct {
	Username string `json:"username"`
	Action   string `json:"action"`
}

type OpenAICreditGrants

type OpenAICreditGrants struct {
	Object         string  `json:"object"`
	TotalGranted   float64 `json:"total_granted"`
	TotalUsed      float64 `json:"total_used"`
	TotalAvailable float64 `json:"total_available"`
}

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 OpenAISBUsageResponse struct {
	Msg  string `json:"msg"`
	Data *struct {
		Credit string `json:"credit"`
	} `json:"data"`
}

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 OpenAIUsageDailyCost struct {
	Timestamp float64 `json:"timestamp"`
	LineItems []struct {
		Name string  `json:"name"`
		Cost float64 `json:"cost"`
	}
}

type OpenAIUsageResponse

type OpenAIUsageResponse struct {
	Object string `json:"object"`
	//DailyCosts []OpenAIUsageDailyCost `json:"daily_costs"`
	TotalUsage float64 `json:"total_usage"` // unit: 0.01 dollar
}

type OpenRouterResponse

type OpenRouterResponse struct {
	Data struct {
		TotalCredits float64 `json:"total_credits"`
		TotalUsage   float64 `json:"total_usage"`
	} `json:"data"`
}

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"`
}

Jump to

Keyboard shortcuts

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