main.go
1.9 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package main
import (
"fmt"
"github.com/astaxie/beego"
"github.com/tiptok/gocomm/config"
"github.com/tiptok/gocomm/pkg/cache"
"github.com/tiptok/gocomm/pkg/log"
"github.com/tiptok/gocomm/pkg/redis"
"gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/constant"
_ "gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/constant"
_ "gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/infrastructure/pg"
_ "gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/infrastructure/redis"
_ "gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/port/beego"
//logx "log"
)
func main() {
defer func() {
}()
beego.BConfig.CopyRequestBody = true
log.InitLog(config.Logger{
Filename: constant.LOG_File,
Level: constant.LOG_LEVEL,
})
cache.InitDefault(cache.WithDefaultRedisPool(redis.GetRedisPool()), cache.WithDebugLog(true, log.DefaultLog), cache.WithDeleteChannel(fmt.Sprintf("%v_%v", constant.POSTGRESQL_DB_NAME, "delkey")))
//log.DefaultLog = console.NewConsoleLog(config.Logger{
// Filename: constant.LOG_File,
// Level: constant.LOG_LEVEL,
//}, fmt.Sprintf("[%v]", constant.POSTGRESQL_DB_NAME), 3)
//{
// // set up a span reporter
// reporter := zipkinhttp.NewReporter("http://106.52.15.41:9411/api/v2/spans")
// defer reporter.Close()
//
// // create our local service endpoint
// endpoint, err := zipkin.NewEndpoint("godevp", "127.0.0.1:8080")
// if err != nil {
// log.Error("unable to create local endpoint: %+v\n", err)
// }
//
// // initialize our tracer
// nativeTracer, err := zipkin.NewTracer(reporter, zipkin.WithLocalEndpoint(endpoint))
// if err != nil {
// log.Error("unable to create tracer: %+v\n", err)
// }
//
// // use zipkin-go-opentracing to wrap our tracer
// tracer := zipkinot.Wrap(nativeTracer)
//
// // optionally set as Global OpenTracing tracer instance
// opentracing.SetGlobalTracer(tracer)
//}
log.Debug(constant.REDIS_HOST, constant.REDIS_PORT)
//go message.RunConsumer()
//go message.RunPublish()
beego.Run()
}