Skip to content

Commit

Permalink
chore: remove the direct reference to the server package (#54)
Browse files Browse the repository at this point in the history
* chore: remove the direct reference to the server package

Signed-off-by: withchao <[email protected]>

* chore: check

Signed-off-by: withchao <[email protected]>

* chore: config

Signed-off-by: withchao <[email protected]>

* chore: phone number

Signed-off-by: withchao <[email protected]>

---------

Signed-off-by: withchao <[email protected]>
  • Loading branch information
withchao committed Jul 26, 2023
1 parent b4fffa5 commit 7c4869b
Show file tree
Hide file tree
Showing 72 changed files with 452 additions and 1,001 deletions.
8 changes: 4 additions & 4 deletions cmd/api/admin_api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"strconv"
"time"

"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mw"
openKeeper "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry/zookeeper"
"github.com/OpenIMSDK/chat/internal/api"
"github.com/OpenIMSDK/chat/pkg/common/config"
openKeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper"
"github.com/OpenIMSDK/tools/log"
"github.com/OpenIMSDK/tools/mw"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

Expand All @@ -38,7 +38,7 @@ func main() {
if err := config.InitConfig(); err != nil {
panic(err)
}
if err := log.InitFromConfig("chat.log", "admin-api", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount); err != nil {
if err := log.InitFromConfig("chat.log", "admin-api", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount, *config.Config.Log.RotationTime); err != nil {
panic(err)
}
zk, err := openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema,
Expand Down
8 changes: 4 additions & 4 deletions cmd/api/chat_api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"strconv"
"time"

"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mw"
openKeeper "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry/zookeeper"
"github.com/OpenIMSDK/chat/internal/api"
"github.com/OpenIMSDK/chat/pkg/common/config"
openKeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper"
"github.com/OpenIMSDK/tools/log"
"github.com/OpenIMSDK/tools/mw"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

Expand All @@ -39,7 +39,7 @@ func main() {
if err != nil {
panic(err)
}
if err := log.InitFromConfig("chat.log", "chat-api", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount); err != nil {
if err := log.InitFromConfig("chat.log", "chat-api", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount, *config.Config.Log.RotationTime); err != nil {
panic(err)
}
zk, err := openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema,
Expand Down
4 changes: 2 additions & 2 deletions cmd/rpc/admin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package main

import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/chat/pkg/common/chatrpcstart"
"github.com/OpenIMSDK/tools/log"

"github.com/OpenIMSDK/chat/internal/rpc/admin"
"github.com/OpenIMSDK/chat/pkg/common/config"
Expand All @@ -26,7 +26,7 @@ func main() {
if err := config.InitConfig(); err != nil {
panic(err)
}
if err := log.InitFromConfig("chat.log", "admin-rpc", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount); err != nil {
if err := log.InitFromConfig("chat.log", "admin-rpc", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount, *config.Config.Log.RotationTime); err != nil {
panic(err)
}
err := chatrpcstart.Start(config.Config.RpcPort.OpenImAdminPort[0], config.Config.RpcRegisterName.OpenImAdminName, 0, admin.Start)
Expand Down
4 changes: 2 additions & 2 deletions cmd/rpc/chat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package main

import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/chat/pkg/common/chatrpcstart"
"github.com/OpenIMSDK/tools/log"

"github.com/OpenIMSDK/chat/internal/rpc/chat"
"github.com/OpenIMSDK/chat/pkg/common/config"
Expand All @@ -26,7 +26,7 @@ func main() {
if err := config.InitConfig(); err != nil {
panic(err)
}
if err := log.InitFromConfig("chat.log", "chat-rpc", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount); err != nil {
if err := log.InitFromConfig("chat.log", "chat-rpc", *config.Config.Log.RemainLogLevel, *config.Config.Log.IsStdout, *config.Config.Log.IsJson, *config.Config.Log.StorageLocation, *config.Config.Log.RemainRotationCount, *config.Config.Log.RotationTime); err != nil {
panic(err)
}
err := chatrpcstart.Start(config.Config.RpcPort.OpenImChatPort[0], config.Config.RpcRegisterName.OpenImChatName, 0, chat.Start)
Expand Down
2 changes: 1 addition & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ log:
# isJson: false
# withStack: false

secret: "tuoyun"
#secret: "openIM123"
#tokenPolicy:
# expire: 86400

Expand Down
49 changes: 15 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ module github.com/OpenIMSDK/chat

go 1.18

// go get -u github.com/OpenIMSDK/Open-IM-Server@main
require (
github.com/OpenIMSDK/open_utils v1.0.8
github.com/gin-gonic/gin v1.9.1
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.0
github.com/jinzhu/copier v0.3.5 // indirect
Expand All @@ -17,92 +16,74 @@ require (
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/mysql v1.3.5
gorm.io/gorm v1.23.8
gorm.io/gorm v1.25.2
)

require (
github.com/OpenIMSDK/Open-IM-Server v0.0.0-20230724100731-9ef94ad46b3f
github.com/alibabacloud-go/darabonba-openapi v0.2.1
github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.18
github.com/alibabacloud-go/tea v1.1.20
github.com/go-sql-driver/mysql v1.6.0
)

require (
github.com/Shopify/sarama v1.32.0 // indirect
github.com/OpenIMSDK/protocol v0.0.1
github.com/OpenIMSDK/tools v0.0.3
)

require (
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
github.com/alibabacloud-go/openapi-util v0.0.11 // indirect
github.com/alibabacloud-go/tea-utils v1.4.5 // indirect
github.com/alibabacloud-go/tea-xml v1.1.2 // indirect
github.com/aliyun/credentials-go v1.1.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bwmarrin/snowflake v0.3.0 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/clbanning/mxj/v2 v2.5.6 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dtm-labs/rockscache v0.1.1 // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
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.14.0 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/go-zookeeper/zk v1.0.3 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
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.16.5 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/lithammer/shortuuid v3.0.0+incompatible // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/redis/go-redis/v9 v9.0.5 // indirect
github.com/tjfoc/gmsm v1.3.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.0 // indirect
github.com/xdg-go/stringprep v1.0.2 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
go.mongodb.org/mongo-driver v1.8.3 // indirect
go.mongodb.org/mongo-driver v1.12.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/image v0.5.0 // indirect
golang.org/x/image v0.9.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)
Loading

0 comments on commit 7c4869b

Please sign in to comment.