git-hook/git_hook.go

26 lines
558 B
Go
Raw Normal View History

2021-10-13 11:23:52 +08:00
// Package git_hook...
//
// Description : git_hook...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2021-10-13 11:11 上午
package main
import (
2021-11-12 11:08:11 +08:00
"encoding/json"
"fmt"
"git.zhangdeman.cn/zhangdeman/gopkg/git_hook"
2021-10-13 11:23:52 +08:00
"github.com/gin-gonic/gin"
)
func main() {
router := gin.Default()
2021-11-12 11:08:11 +08:00
// 注册回调路由
_ = git_hook.RegisterGitHookRouter(router, func(ctx *gin.Context, hookData *git_hook.HookData) {
callbackData, _ := json.Marshal(hookData)
fmt.Println("回调数据 : ", string(callbackData))
})
_ = router.Run(":12590")
2021-10-13 11:23:52 +08:00
}