Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename friend module to relation. #2463

Merged
merged 27 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1b56405
update protocol in go mod.
mo3et Jul 26, 2024
1e0d74f
add debug log in writePongMsg.
mo3et Jul 26, 2024
824392e
update log level.
mo3et Jul 26, 2024
d612429
Merge branch 'main' of github.com:openimsdk/open-im-server into refac…
mo3et Jul 26, 2024
b41823f
Merge branch 'main' of github.com:openimsdk/open-im-server into refac…
mo3et Jul 26, 2024
144a404
Merge branch 'main' of github.com:openimsdk/open-im-server into refac…
mo3et Jul 26, 2024
cac45e4
Merge branch 'openimsdk:main' into refactor/parse-token
mo3et Jul 26, 2024
7667af4
Merge branch 'refactor/parse-token' of github.com:mo3et/open-im-serve…
mo3et Jul 26, 2024
83dd8a4
Merge branch 'main' of github.com:openimsdk/open-im-server into refac…
mo3et Jul 26, 2024
34e1c60
Merge branch 'openimsdk:main' into refactor/parse-token
mo3et Jul 26, 2024
86e3e38
Merge branch 'refactor/parse-token' of github.com:mo3et/open-im-serve…
mo3et Jul 26, 2024
8a8b99a
add Warn log in writePongMsg.
mo3et Jul 28, 2024
567ceaf
Merge branch 'main' of github.com:openimsdk/open-im-server into refac…
mo3et Jul 28, 2024
a230f0e
add debug log.
mo3et Jul 28, 2024
61a417d
Merge branch 'openimsdk:main' into refactor/parse-token
mo3et Jul 29, 2024
291a318
Merge branch 'main' of github.com:openimsdk/open-im-server into refac…
mo3et Jul 29, 2024
da08d55
feat: update webhookBeforeMemberJoinGroup to batch method.
mo3et Jul 30, 2024
2eeb6aa
Merge branch 'refactor/parse-token' of github.com:mo3et/open-im-serve…
mo3et Jul 30, 2024
7cea317
Merge branch 'main' of github.com:openimsdk/open-im-server into refac…
mo3et Jul 30, 2024
ba170ba
feat: update version field implement.
mo3et Jul 30, 2024
a386110
update webhook implement contents.
mo3et Jul 30, 2024
ab268c5
update method field and contents.
mo3et Jul 30, 2024
4c70bff
update callbackCommand field.
mo3et Jul 30, 2024
96b7c8d
fix: add correct fields.
mo3et Jul 30, 2024
3307241
update struct tags.
mo3et Jul 30, 2024
e74fa5c
Merge branch 'main' of github.com:openimsdk/open-im-server into refac…
mo3et Jul 31, 2024
1237549
refactor: rename friend module to relation.
mo3et Jul 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package friend
package relation

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package friend
package relation

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package friend
package relation

import (
"context"

"github.com/openimsdk/tools/mq/memamq"

"github.com/openimsdk/open-im-server/v3/pkg/common/config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package friend
package relation

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package friend
package relation

import (
"context"
Expand Down
6 changes: 3 additions & 3 deletions internal/rpc/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package user
import (
"context"
"errors"
"github.com/openimsdk/open-im-server/v3/internal/rpc/friend"
"github.com/openimsdk/open-im-server/v3/internal/rpc/relation"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics"
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache"
Expand Down Expand Up @@ -54,7 +54,7 @@ import (
type userServer struct {
online cache.OnlineCache
db controller.UserDatabase
friendNotificationSender *friend.FriendNotificationSender
friendNotificationSender *relation.FriendNotificationSender
userNotificationSender *UserNotificationSender
friendRpcClient *rpcclient.FriendRpcClient
groupRpcClient *rpcclient.GroupRpcClient
Expand Down Expand Up @@ -105,7 +105,7 @@ func Start(ctx context.Context, config *Config, client registry.SvcDiscoveryRegi
RegisterCenter: client,
friendRpcClient: &friendRpcClient,
groupRpcClient: &groupRpcClient,
friendNotificationSender: friend.NewFriendNotificationSender(&config.NotificationConfig, &msgRpcClient, friend.WithDBFunc(database.FindWithError)),
friendNotificationSender: relation.NewFriendNotificationSender(&config.NotificationConfig, &msgRpcClient, relation.WithDBFunc(database.FindWithError)),
userNotificationSender: NewUserNotificationSender(config, &msgRpcClient, WithUserFunc(database.FindWithError)),
config: config,
webhookClient: webhook.NewWebhookClient(config.WebhooksConfig.URL),
Expand Down
34 changes: 17 additions & 17 deletions pkg/common/cmd/friend.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package cmd
import (
"context"

"github.com/openimsdk/open-im-server/v3/internal/rpc/friend"
"github.com/openimsdk/open-im-server/v3/internal/rpc/relation"
"github.com/openimsdk/open-im-server/v3/pkg/common/startrpc"
"github.com/openimsdk/open-im-server/v3/version"
"github.com/openimsdk/tools/system/program"
Expand All @@ -26,23 +26,23 @@ import (

type FriendRpcCmd struct {
*RootCmd
ctx context.Context
configMap map[string]any
friendConfig *friend.Config
ctx context.Context
configMap map[string]any
relationConfig *relation.Config
}

func NewFriendRpcCmd() *FriendRpcCmd {
var friendConfig friend.Config
ret := &FriendRpcCmd{friendConfig: &friendConfig}
var relationConfig relation.Config
ret := &FriendRpcCmd{relationConfig: &relationConfig}
ret.configMap = map[string]any{
OpenIMRPCFriendCfgFileName: &friendConfig.RpcConfig,
RedisConfigFileName: &friendConfig.RedisConfig,
MongodbConfigFileName: &friendConfig.MongodbConfig,
ShareFileName: &friendConfig.Share,
NotificationFileName: &friendConfig.NotificationConfig,
WebhooksConfigFileName: &friendConfig.WebhooksConfig,
LocalCacheConfigFileName: &friendConfig.LocalCacheConfig,
DiscoveryConfigFilename: &friendConfig.Discovery,
OpenIMRPCFriendCfgFileName: &relationConfig.RpcConfig,
RedisConfigFileName: &relationConfig.RedisConfig,
MongodbConfigFileName: &relationConfig.MongodbConfig,
ShareFileName: &relationConfig.Share,
NotificationFileName: &relationConfig.NotificationConfig,
WebhooksConfigFileName: &relationConfig.WebhooksConfig,
LocalCacheConfigFileName: &relationConfig.LocalCacheConfig,
DiscoveryConfigFilename: &relationConfig.Discovery,
}
ret.RootCmd = NewRootCmd(program.GetProcessName(), WithConfigMap(ret.configMap))
ret.ctx = context.WithValue(context.Background(), "version", version.Version)
Expand All @@ -57,7 +57,7 @@ func (a *FriendRpcCmd) Exec() error {
}

func (a *FriendRpcCmd) runE() error {
return startrpc.Start(a.ctx, &a.friendConfig.Discovery, &a.friendConfig.RpcConfig.Prometheus, a.friendConfig.RpcConfig.RPC.ListenIP,
a.friendConfig.RpcConfig.RPC.RegisterIP, a.friendConfig.RpcConfig.RPC.Ports,
a.Index(), a.friendConfig.Share.RpcRegisterName.Friend, &a.friendConfig.Share, a.friendConfig, friend.Start)
return startrpc.Start(a.ctx, &a.relationConfig.Discovery, &a.relationConfig.RpcConfig.Prometheus, a.relationConfig.RpcConfig.RPC.ListenIP,
a.relationConfig.RpcConfig.RPC.RegisterIP, a.relationConfig.RpcConfig.RPC.Ports,
a.Index(), a.relationConfig.Share.RpcRegisterName.Friend, &a.relationConfig.Share, a.relationConfig, relation.Start)
}
Loading