mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-06-13 15:47:37 +08:00
chore(deps): update Go dependencies
- Update all dependencies to latest versions - Upgrade touka to break/v1 branch - Migrate from RunShutdown to Run with graceful shutdown options - Use functional options pattern: WithAddr and WithGracefulShutdownDefault
This commit is contained in:
parent
32baca85db
commit
3d01d4cd15
7 changed files with 51 additions and 46 deletions
22
api/api.go
22
api/api.go
|
|
@ -52,35 +52,35 @@ func InitHandleRouter(cfg *config.Config, r *touka.Engine, version string) {
|
|||
func SizeLimitHandler(cfg *config.Config, c *touka.Context) {
|
||||
sizeLimit := cfg.Server.SizeLimit
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"MaxResponseBodySize": sizeLimit,
|
||||
}))
|
||||
}
|
||||
|
||||
func WhiteListStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Whitelist": cfg.Whitelist.Enabled,
|
||||
}))
|
||||
}
|
||||
|
||||
func BlackListStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Blacklist": cfg.Blacklist.Enabled,
|
||||
}))
|
||||
}
|
||||
|
||||
func CorsStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Cors": cfg.Server.Cors,
|
||||
}))
|
||||
}
|
||||
|
||||
func HealthcheckHandler(c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Status": "OK",
|
||||
"Repo": "WJQSERVER-STUDIO/GHProxy",
|
||||
"Author": "WJQSERVER-STUDIO",
|
||||
|
|
@ -89,7 +89,7 @@ func HealthcheckHandler(c *touka.Context) {
|
|||
|
||||
func VersionHandler(c *touka.Context, version string) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"Version": version,
|
||||
"Repo": "WJQSERVER-STUDIO/GHProxy",
|
||||
"Author": "WJQSERVER-STUDIO",
|
||||
|
|
@ -98,35 +98,35 @@ func VersionHandler(c *touka.Context, version string) {
|
|||
|
||||
func RateLimitStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"RateLimit": cfg.RateLimit.Enabled,
|
||||
}))
|
||||
}
|
||||
|
||||
func RateLimitLimitHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"RatePerMinute": cfg.RateLimit.RatePerMinute,
|
||||
}))
|
||||
}
|
||||
|
||||
func SmartGitStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"enabled": cfg.GitClone.Mode == "cache",
|
||||
}))
|
||||
}
|
||||
|
||||
func shellNestStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"enabled": cfg.Shell.Editor,
|
||||
}))
|
||||
}
|
||||
|
||||
func ociProxyStatusHandler(cfg *config.Config, c *touka.Context) {
|
||||
c.SetHeader("Content-Type", "application/json")
|
||||
c.JSON(200, (map[string]interface{}{
|
||||
c.JSON(200, (map[string]any{
|
||||
"enabled": cfg.Docker.Enabled,
|
||||
"target": cfg.Docker.Target,
|
||||
}))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue