-
Notifications
You must be signed in to change notification settings - Fork 13
/
router.go
62 lines (51 loc) · 2.36 KB
/
router.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package middleware
import (
"github.com/gin-gonic/gin"
"github.com/coretrix/hitrix/pkg/controller"
"github.com/coretrix/hitrix/service"
)
func Router(ginEngine *gin.Engine) {
_ = service.DI().JWT()
var devPanel *controller.DevPanelController
{
devGroup := ginEngine.Group("/dev/")
if !service.DI().App().IsInLocalMode() {
devGroup.Use(AuthorizeDevUser())
}
{
//ginEngine.GET("/dev/action-list/", devPanel.GetActionListAction)
devGroup.GET("settings/", devPanel.GetSettingsAction)
devGroup.GET("clear-cache/", devPanel.GetClearCacheAction)
devGroup.GET("clear-redis-streams/", devPanel.GetClearRedisStreamsAction)
devGroup.DELETE("delete-redis-stream/:name/", devPanel.DeleteRedisStreamAction)
devGroup.GET("alters/", devPanel.GetAlters)
devGroup.GET("envs/", devPanel.GetEnvValues)
devGroup.GET("redis-search/alters/", devPanel.GetRedisSearchAlters)
devGroup.GET("redis-search/statistics/", devPanel.GetRedisSearchStatistics)
devGroup.GET("redis-search/indexes/", devPanel.GetRedisSearchIndexes)
devGroup.GET("redis-search/index/info/:index/", devPanel.PostRedisSearchIndexInfo)
devGroup.GET("redis-search/force-reindex/:index/", devPanel.PostRedisSearchForceReindex)
devGroup.GET("redis-search/force-reindex-all/", devPanel.PostRedisSearchForceReindexAll)
devGroup.GET("redis-streams/", devPanel.GetRedisStreams)
devGroup.GET("redis-statistics/", devPanel.GetRedisStatistics)
ginEngine.GET("dev/create-dev-panel-user/", devPanel.CreateDevPanelUserAction)
ginEngine.POST("dev/login/", devPanel.PostLoginDevPanelAction)
ginEngine.POST("dev/generate-token/", AuthorizeWithDevRefreshToken(), devPanel.PostGenerateTokenAction)
devGroup.GET("feature-flag/list/", devPanel.GetFeatureFlags)
devGroup.POST("feature-flag/enable/:name/", devPanel.PostEnableFeatureFlag)
devGroup.POST("feature-flag/disable/:name/", devPanel.PostDisableFeatureFlag)
devGroup.POST("request-logger/list/", devPanel.PostRequestsLogger)
}
}
var errorLog *controller.ErrorLogController
{
errorLogGroup := ginEngine.Group("/error-log/")
if !service.DI().App().IsInLocalMode() {
errorLogGroup.Use(AuthorizeDevUser())
}
errorLogGroup.GET("errors/", errorLog.GetErrors)
errorLogGroup.GET("remove/:id/", errorLog.DeleteError)
errorLogGroup.GET("remove-all/", errorLog.DeleteAllErrors)
errorLogGroup.GET("panic/", errorLog.Panic)
}
}