relation

package
v3.8.1-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryRegistry, server *grpc.Server) error

func WithDBFunc

func WithDBFunc(
	fn func(ctx context.Context, userIDs []string) (users []*relationtb.User, err error),
) friendNotificationSenderOptions

func WithFriendDB

func WithFriendDB(db controller.FriendDatabase) friendNotificationSenderOptions

func WithRpcFunc

func WithRpcFunc(
	fn func(ctx context.Context, userIDs []string) ([]*sdkws.UserInfo, error),
) friendNotificationSenderOptions

Types

type Config

type Config struct {
	RpcConfig     config.Friend
	RedisConfig   config.Redis
	MongodbConfig config.Mongo
	// ZookeeperConfig    config.ZooKeeper
	NotificationConfig config.Notification
	Share              config.Share
	WebhooksConfig     config.Webhooks
	LocalCacheConfig   config.LocalCache
	Discovery          config.Discovery
}

type FriendNotificationSender

type FriendNotificationSender struct {
	*rpcclient.NotificationSender
	// contains filtered or unexported fields
}

func NewFriendNotificationSender

func NewFriendNotificationSender(
	conf *config.Notification,
	msgRpcClient *rpcclient.MessageRpcClient,
	opts ...friendNotificationSenderOptions,
) *FriendNotificationSender

func (*FriendNotificationSender) BlackAddedNotification

func (f *FriendNotificationSender) BlackAddedNotification(ctx context.Context, req *relation.AddBlackReq)

func (*FriendNotificationSender) BlackDeletedNotification

func (f *FriendNotificationSender) BlackDeletedNotification(ctx context.Context, req *relation.RemoveBlackReq)

func (*FriendNotificationSender) FriendAddedNotification

func (f *FriendNotificationSender) FriendAddedNotification(
	ctx context.Context,
	operationID, opUserID, fromUserID, toUserID string,
) error

func (*FriendNotificationSender) FriendApplicationAddNotification

func (f *FriendNotificationSender) FriendApplicationAddNotification(ctx context.Context, req *relation.ApplyToAddFriendReq)

func (*FriendNotificationSender) FriendApplicationAgreedNotification

func (f *FriendNotificationSender) FriendApplicationAgreedNotification(
	ctx context.Context,
	req *relation.RespondFriendApplyReq,
)

func (*FriendNotificationSender) FriendApplicationRefusedNotification

func (f *FriendNotificationSender) FriendApplicationRefusedNotification(
	ctx context.Context,
	req *relation.RespondFriendApplyReq,
)

func (*FriendNotificationSender) FriendDeletedNotification

func (f *FriendNotificationSender) FriendDeletedNotification(ctx context.Context, req *relation.DeleteFriendReq)

func (*FriendNotificationSender) FriendInfoUpdatedNotification

func (f *FriendNotificationSender) FriendInfoUpdatedNotification(ctx context.Context, changedUserID string, needNotifiedUserID string)

func (*FriendNotificationSender) FriendRemarkSetNotification

func (f *FriendNotificationSender) FriendRemarkSetNotification(ctx context.Context, fromUserID, toUserID string)

func (*FriendNotificationSender) FriendsInfoUpdateNotification

func (f *FriendNotificationSender) FriendsInfoUpdateNotification(ctx context.Context, toUserID string, friendIDs []string)

func (*FriendNotificationSender) UserInfoUpdatedNotification

func (f *FriendNotificationSender) UserInfoUpdatedNotification(ctx context.Context, changedUserID string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL