Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
longpi1 committed May 3, 2024
1 parent 3edd7dc commit 1ac162e
Show file tree
Hide file tree
Showing 123 changed files with 464 additions and 1,436 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# Dependency directories (remove the queue below to include it)
# vendor/

# Go workspace file
Expand Down
3 changes: 2 additions & 1 deletion Intelligent_contact_service/libary/queue/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package queue
import (
"context"
"fmt"
"relation-service/libary/log"
"time"

"github.com/longpi1/gopkg/libary/log"

"github.com/IBM/sarama"
)

Expand Down
3 changes: 2 additions & 1 deletion Intelligent_contact_service/libary/queue/redismq.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
"encoding/json"
"errors"
"fmt"
"relation-service/libary/log"
"relation-service/model/dao/cache/redis"
"time"

"github.com/longpi1/gopkg/libary/log"

redis2 "github.com/go-redis/redis"
)

Expand Down
3 changes: 2 additions & 1 deletion comment/comment-job/bootstrap/boststarp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package bootstrap

import (
"comment-job/libary/conf"
"comment-job/libary/log"
localcache "comment-job/model/dao/cache/local_cache"
"comment-job/model/dao/cache/redis"
"comment-job/model/dao/db"

"github.com/longpi1/gopkg/libary/log"
)

func Boostrap(config *conf.WebConfig) error {
Expand Down
40 changes: 40 additions & 0 deletions comment/comment-job/cmd/queue/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"comment-job/bootstrap"
"comment-job/httpserver"
"comment-job/libary/conf"
"comment-job/model/dao/cache/redis"
"context"

"github.com/longpi1/gopkg/libary/log"
"github.com/longpi1/gopkg/libary/queue"
"github.com/longpi1/gopkg/libary/utils"
)

func main() {
config := conf.GetConfig()
log.NewLogger(config.AppConfig.Debug, config.AppConfig.LogFilePath)

err := bootstrap.Boostrap(config)
if err != nil {
log.Fatal("boostrap fail", err)
}
// 启动http服务路由
httpserver.SetRouter(config.AppConfig.Port)

// 启动队列进行消费
queue.StartConsumersListener(context.Background())

// 优雅关闭
utils.NewHook().Close(
// 关闭 cache
func() {
if redis.GetClient() != nil {
if err := redis.GetClient().Close(); err != nil {
log.Error("redis cache close err", err)
}
}
},
)
}
28 changes: 15 additions & 13 deletions comment/comment-job/go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
module comment-job

go 1.22

toolchain go1.22.2
go 1.22.2

require (
github.com/IBM/sarama v1.43.1
github.com/apache/pulsar-client-go v0.12.1
github.com/apache/rocketmq-client-go/v2 v2.1.2
github.com/fsnotify/fsnotify v1.7.0
github.com/gin-contrib/cors v1.7.1
github.com/gin-contrib/pprof v1.4.0
github.com/gin-gonic/gin v1.9.1
github.com/go-redis/redis v6.15.9+incompatible
github.com/jinzhu/gorm v1.9.16
github.com/longpi1/gopkg v0.0.0-20240502085530-495b32733a48
github.com/mlogclub/simple v1.2.25
github.com/panjf2000/ants/v2 v2.9.1
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
Expand All @@ -32,6 +28,9 @@ require (
github.com/99designs/keyring v1.2.1 // indirect
github.com/AthenZ/athenz v1.10.39 // indirect
github.com/DataDog/zstd v1.5.0 // indirect
github.com/IBM/sarama v1.43.2 // indirect
github.com/apache/pulsar-client-go v0.12.1 // indirect
github.com/apache/rocketmq-client-go/v2 v2.1.2 // indirect
github.com/ardielle/ardielle-go v1.5.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.4.0 // indirect
Expand All @@ -50,14 +49,15 @@ require (
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.19.0 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/go-sql-driver/mysql v1.7.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogf/gf/v2 v2.7.0 // indirect
github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/mock v1.4.3 // indirect
github.com/golang/mock v1.4.4 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
Expand All @@ -79,7 +79,7 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/linkedin/goavro/v2 v2.9.8 // indirect
Expand Down Expand Up @@ -118,16 +118,18 @@ require (
github.com/tidwall/pretty v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
go.opentelemetry.io/otel v1.14.0 // indirect
go.opentelemetry.io/otel/trace v1.14.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
Expand Down
Loading

0 comments on commit 1ac162e

Please sign in to comment.