@@ -27,44 +27,47 @@ func (c *Controller) GetEngine() *gin.Engine {
2727}
2828
2929func (c * Controller ) SetupRoutes () {
30- c .setupHealthRoutes ()
30+ c .setupCoreRoutes ()
3131 c .setupContainerRoutes ()
3232 c .setupMemoryRoutes ()
3333 c .setupCpuRoutes ()
3434}
3535
36- func (c * Controller ) setupHealthRoutes () {
37- c .ginE .GET ("/api/health" , func (c * gin.Context ) {
38- c .String (200 , "ok" )
36+ func (c * Controller ) setupCoreRoutes () {
37+ c .ginE .GET ("/api/health" , func (ctx * gin.Context ) {
38+ ctx .String (200 , "ok" )
39+ })
40+ c .ginE .GET ("/api/version" , func (ctx * gin.Context ) {
41+ ctx .String (200 , c .config .Version )
3942 })
4043}
4144
4245// TODO: Implement c.setupPushRoutes()
4346func (c * Controller ) SetupDebugRoutes () {
4447 c .setupDebugRoutes ()
4548 debugGroup := c .ginE .Group ("/debug" )
46- debugGroup .GET ("/pprof" , func (c * gin.Context ) {
47- pprof .Index (c .Writer , c .Request )
49+ debugGroup .GET ("/pprof" , func (ctx * gin.Context ) {
50+ pprof .Index (ctx .Writer , ctx .Request )
4851 })
49- debugGroup .GET ("/cmdline" , func (c * gin.Context ) {
50- pprof .Cmdline (c .Writer , c .Request )
52+ debugGroup .GET ("/cmdline" , func (ctx * gin.Context ) {
53+ pprof .Cmdline (ctx .Writer , ctx .Request )
5154 })
52- debugGroup .GET ("/profile" , func (c * gin.Context ) {
53- pprof .Profile (c .Writer , c .Request )
55+ debugGroup .GET ("/profile" , func (ctx * gin.Context ) {
56+ pprof .Profile (ctx .Writer , ctx .Request )
5457 })
55- debugGroup .GET ("/symbol" , func (c * gin.Context ) {
56- pprof .Symbol (c .Writer , c .Request )
58+ debugGroup .GET ("/symbol" , func (ctx * gin.Context ) {
59+ pprof .Symbol (ctx .Writer , ctx .Request )
5760 })
58- debugGroup .GET ("/trace" , func (c * gin.Context ) {
59- pprof .Trace (c .Writer , c .Request )
61+ debugGroup .GET ("/trace" , func (ctx * gin.Context ) {
62+ pprof .Trace (ctx .Writer , ctx .Request )
6063 })
61- debugGroup .GET ("/heap" , func (c * gin.Context ) {
62- pprof .Handler ("heap" ).ServeHTTP (c .Writer , c .Request )
64+ debugGroup .GET ("/heap" , func (ctx * gin.Context ) {
65+ pprof .Handler ("heap" ).ServeHTTP (ctx .Writer , ctx .Request )
6366 })
64- debugGroup .GET ("/goroutine" , func (c * gin.Context ) {
65- pprof .Handler ("goroutine" ).ServeHTTP (c .Writer , c .Request )
67+ debugGroup .GET ("/goroutine" , func (ctx * gin.Context ) {
68+ pprof .Handler ("goroutine" ).ServeHTTP (ctx .Writer , ctx .Request )
6669 })
67- debugGroup .GET ("/block" , func (c * gin.Context ) {
68- pprof .Handler ("block" ).ServeHTTP (c .Writer , c .Request )
70+ debugGroup .GET ("/block" , func (ctx * gin.Context ) {
71+ pprof .Handler ("block" ).ServeHTTP (ctx .Writer , ctx .Request )
6972 })
7073}
0 commit comments