Documentation ¶
Index ¶
- func AdminAuth(c *gin.Context)
- func CORS() gin.HandlerFunc
- func Distribute(c *gin.Context)
- func ForceRateLimit(ctx context.Context, key string, maxRequestNum int, duration time.Duration) bool
- func GlobalAPIRateLimit(c *gin.Context)
- func MemoryRateLimit(_ context.Context, key string, maxRequestNum int, duration time.Duration) bool
- func RateLimit(ctx context.Context, key string, maxRequestNum int, duration time.Duration) (bool, error)
- func RelayPanicRecover(c *gin.Context)
- func RequestID(c *gin.Context)
- func SetUpLogger(server *gin.Engine)
- func SetupContextForSelectedChannel(c *gin.Context, channel *model.Channel, modelName string)
- func TokenAuth(c *gin.Context)
- type ModelRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORS ¶
func CORS() gin.HandlerFunc
func Distribute ¶
func ForceRateLimit ¶
func ForceRateLimit(ctx context.Context, key string, maxRequestNum int, duration time.Duration) bool
ignore redis error
func GlobalAPIRateLimit ¶
func MemoryRateLimit ¶
func RelayPanicRecover ¶
func SetUpLogger ¶
Types ¶
type ModelRequest ¶
type ModelRequest struct {
Model string `form:"model" json:"model"`
}
Click to show internal directories.
Click to hide internal directories.