DKube/main.go
2022-09-25 20:02:35 +08:00

20 lines
393 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 main
import (
"dkube/config"
"dkube/controller"
"dkube/service"
"github.com/gin-gonic/gin"
)
func main() {
//初始化k8s client
service.K8s.Init() //可以使用service.K8s.ClientSet 跨包调用
//初始化Gin对象
r := gin.Default()
//跨包调用router的方法初始化路由规则
controller.Router.InitApiRouter(r)
//启动gin程序
r.Run(config.ListenAddr)
}