-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
31 lines (26 loc) · 673 Bytes
/
Copy pathmain.go
File metadata and controls
31 lines (26 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"fmt"
"log"
"github.com/AGou-ops/gitlab-dingtalk-webhook/app"
"github.com/AGou-ops/gitlab-dingtalk-webhook/dingtalk"
"github.com/AGou-ops/gitlab-dingtalk-webhook/gitlab"
"github.com/gin-gonic/gin"
)
func main() {
// 从环境变量或者配置文件中获取配置信息
env := app.GetEnv()
webhook, _ := gitlab.New(
gitlab.Options.Secret("bjPyrYvx-hwwd1LSw8TS"),
)
dingtalk_robot := dingtalk.NewRobot(env.Token, env.Secret)
r := gin.Default()
err := app.StartService(*env, r, webhook, dingtalk_robot)
if err != nil {
log.Println(err)
}
err = r.Run(fmt.Sprintf(":%d", env.ListenPort))
if err != nil {
log.Println(err)
}
}