You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"flag"
|
|
|
|
"git.gz.internal.jumaiyx.cn/pkg/config"
|
|
|
|
"git.gz.internal.jumaiyx.cn/pkg/log"
|
|
|
|
"os"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
Name string
|
|
|
|
Version string
|
|
|
|
|
|
|
|
id, _ = os.Hostname()
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
bc, err := config.NewConfig().Load()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
l := log.DefaultLogger()
|
|
|
|
biz, cleanup, err := wireApp(l, bc.Data, bc.Webhook)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
defer cleanup()
|
|
|
|
ctx := context.TODO()
|
|
|
|
l.WithContext(ctx)
|
|
|
|
biz.Run(ctx)
|
|
|
|
time.Sleep(time.Second * 10)
|
|
|
|
}
|