DKube/controller/router.go
2022-09-25 21:05:00 +08:00

25 lines
686 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package controller
import (
"github.com/gin-gonic/gin"
)
// Router 初始化router类型的对象首字母大写用于跨包调用跨目录调用
var Router router
//声明router结构体
type router struct{}
// InitApiRouter 初始化路由规则创建api测试接口
func (r *router) InitApiRouter(router *gin.Engine) {
router.
//pod操作
GET("/api/k8s/pods", Pod.GetPods).
GET("/api/k8s/pod/detail", Pod.GetPodDetail).
DELETE("/api/k8s/pod/del", Pod.DeletePod).
PUT("/api/k8s/pod/update", Pod.UpdatePod).
GET("/api/k8s/pod/container", Pod.GetPodContainer).
GET("/api/k8s/pod/log", Pod.GetPodLog).
GET("/api/k8s/pod/numnp", Pod.GetPodNumPerNp)
}