DKube v0.1
This commit is contained in:
19
main.go
Normal file
19
main.go
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"k8s-platform/config"
|
||||
"k8s-platform/controller"
|
||||
"k8s-platform/service"
|
||||
)
|
||||
|
||||
func main() {
|
||||
//初始化k8s client
|
||||
service.K8s.Init() //可以使用service.K8s.ClientSet 跨包调用
|
||||
//初始化Gin对象
|
||||
r := gin.Default()
|
||||
//跨包调用router的方法,初始化路由规则
|
||||
controller.Router.InitApiRouter(r)
|
||||
//启动gin程序
|
||||
r.Run(config.ListenAddr)
|
||||
}
|
Reference in New Issue
Block a user