Documentation
¶
Index ¶
- func ActivityLog(c *gin.Context)
- func CreateAPIKey(c *gin.Context)
- func DeleteAPIKey(c *gin.Context)
- func GenerateAPIKey(c *gin.Context)
- func GetProfile(c *gin.Context)
- func GetUserAPIKey(c *gin.Context)
- func GetUserStats(c *gin.Context)
- func ListAPIKeys(c *gin.Context)
- func ListUsers(c *gin.Context)
- func Login(c *gin.Context)
- func Logout(c *gin.Context)
- func RefreshToken(c *gin.Context)
- func Register(c *gin.Context)
- func Stats(c *gin.Context)
- func UpdateAPIKey(c *gin.Context)
- func UpdateProfile(c *gin.Context)
- type APIKeyUpdateRequest
- type CreateAPIKeyRequest
- type LoginRequest
- type RegistrationRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivityLog ¶
func GenerateAPIKey ¶
GenerateAPIKey generates a new API key for the authenticated user with default limits.
func GetProfile ¶
GetProfile returns the profile of the currently authenticated user.
func GetUserAPIKey ¶
GetUserAPIKey returns the current API key for the authenticated user.
func GetUserStats ¶
GetUserStats returns comprehensive API statistics for the current user's API key, including total requests, average response time (ms), remaining credits, global requests, and the key details.
func UpdateProfile ¶
UpdateProfile allows a user to update their profile.
Types ¶
type APIKeyUpdateRequest ¶
type APIKeyUpdateRequest struct { UserID string `json:"user_id" binding:"required"` RateLimit int `json:"rate_limit" binding:"required"` Concurrency int `json:"concurrency" binding:"required"` }
APIKeyUpdateRequest represents the payload for updating an API key.
type CreateAPIKeyRequest ¶
type CreateAPIKeyRequest struct { UserID string `json:"user_id" binding:"required"` RateLimit int `json:"rate_limit" binding:"required"` Concurrency int `json:"concurrency" binding:"required"` }
CreateAPIKeyRequest represents the payload for creating an API key.
type LoginRequest ¶
type LoginRequest struct { Username string `json:"username" binding:"required"` Password string `json:"password" binding:"required"` }
LoginRequest represents the payload for user login.
type RegistrationRequest ¶
type RegistrationRequest struct { Username string `json:"username" binding:"required,min=3"` Password string `json:"password" binding:"required,min=6"` }
RegistrationRequest represents the payload for user registration.