controller

package
v0.0.0-...-bddbc0c Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChannel

func AddChannel(c *gin.Context)

func AddRedemption

func AddRedemption(c *gin.Context)

func AddToken

func AddToken(c *gin.Context)

func AdminTopUp

func AdminTopUp(c *gin.Context)

func AutomaticallyTestChannels

func AutomaticallyTestChannels(frequency int)

func AutomaticallyUpdateChannels

func AutomaticallyUpdateChannels(frequency int)

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 DeleteHistoryLogs

func DeleteHistoryLogs(c *gin.Context)

func DeleteRedemption

func DeleteRedemption(c *gin.Context)

func DeleteSelf

func DeleteSelf(c *gin.Context)

func DeleteToken

func DeleteToken(c *gin.Context)

func DeleteUser

func DeleteUser(c *gin.Context)

func EmailBind

func EmailBind(c *gin.Context)

func GenerateAccessToken

func GenerateAccessToken(c *gin.Context)

func GetAbout

func GetAbout(c *gin.Context)

func GetAffCode

func GetAffCode(c *gin.Context)

func GetAllChannels

func GetAllChannels(c *gin.Context)

func GetAllLogs

func GetAllLogs(c *gin.Context)

func GetAllRedemptions

func GetAllRedemptions(c *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 GetHomePageContent

func GetHomePageContent(c *gin.Context)

func GetLogsSelfStat

func GetLogsSelfStat(c *gin.Context)

func GetLogsStat

func GetLogsStat(c *gin.Context)

func GetNotice

func GetNotice(c *gin.Context)

func GetOptions

func GetOptions(c *gin.Context)

func GetRedemption

func GetRedemption(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 Register

func Register(c *gin.Context)

func Relay

func Relay(c *gin.Context)

func RelayNotFound

func RelayNotFound(c *gin.Context)

func RelayNotImplemented

func RelayNotImplemented(c *gin.Context)

func ResetPassword

func ResetPassword(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 SearchRedemptions

func SearchRedemptions(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 SendEmailVerification

func SendEmailVerification(c *gin.Context)

func SendPasswordResetEmail

func SendPasswordResetEmail(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 TopUp

func TopUp(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 UpdateOption

func UpdateOption(c *gin.Context)

func UpdateRedemption

func UpdateRedemption(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 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"`
}

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 PasswordResetRequest

type PasswordResetRequest struct {
	Email string `json:"email"`
	Token string `json:"token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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