mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-17 15:29:03 +08:00
msg database
This commit is contained in:
@@ -19,10 +19,10 @@ var Terminal = []int{constant.IOSPlatformID, constant.AndroidPlatformID, constan
|
||||
|
||||
type Fcm struct {
|
||||
fcmMsgCli *messaging.Client
|
||||
cache cache.Cache
|
||||
cache cache.MsgCache
|
||||
}
|
||||
|
||||
func NewClient(cache cache.Cache) *Fcm {
|
||||
func NewClient(cache cache.MsgCache) *Fcm {
|
||||
opt := option.WithCredentialsFile(filepath.Join(config.Root, "config", config.Config.Push.Fcm.ServiceAccount))
|
||||
fcmApp, err := firebase.NewApp(context.Background(), nil, opt)
|
||||
if err != nil {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func Test_Push(t *testing.T) {
|
||||
var redis cache.Cache
|
||||
var redis cache.MsgCache
|
||||
offlinePusher := NewClient(redis)
|
||||
err := offlinePusher.Push(context.Background(), []string{"userID1"}, "test", "test", &push.Opts{})
|
||||
assert.Nil(t, err)
|
||||
|
||||
@@ -37,12 +37,12 @@ const (
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
cache cache.Cache
|
||||
cache cache.MsgCache
|
||||
tokenExpireTime int64
|
||||
taskIDTTL int64
|
||||
}
|
||||
|
||||
func NewClient(cache cache.Cache) *Client {
|
||||
func NewClient(cache cache.MsgCache) *Client {
|
||||
return &Client{cache: cache, tokenExpireTime: tokenExpireTime, taskIDTTL: taskIDTTL}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ type Push struct {
|
||||
}
|
||||
|
||||
func (p *Push) Init(rpcPort int) {
|
||||
var cacheInterface cache.Cache
|
||||
var cacheInterface cache.MsgCache
|
||||
|
||||
p.rpcServer.Init(rpcPort, cacheInterface)
|
||||
p.pushCh.Init()
|
||||
|
||||
@@ -26,7 +26,7 @@ type RPCServer struct {
|
||||
push controller.PushInterface
|
||||
}
|
||||
|
||||
func (r *RPCServer) Init(rpcPort int, cache cache.Cache) {
|
||||
func (r *RPCServer) Init(rpcPort int, cache cache.MsgCache) {
|
||||
r.rpcPort = rpcPort
|
||||
r.rpcRegisterName = config.Config.RpcRegisterName.OpenImPushName
|
||||
r.etcdSchema = config.Config.Etcd.EtcdSchema
|
||||
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
)
|
||||
|
||||
type Pusher struct {
|
||||
cache cache.Cache
|
||||
cache cache.MsgCache
|
||||
client discoveryregistry.SvcDiscoveryRegistry
|
||||
offlinePusher OfflinePusher
|
||||
groupLocalCache localcache.GroupLocalCache
|
||||
@@ -33,7 +33,7 @@ type Pusher struct {
|
||||
successCount int
|
||||
}
|
||||
|
||||
func NewPusher(cache cache.Cache, client discoveryregistry.SvcDiscoveryRegistry, offlinePusher OfflinePusher) *Pusher {
|
||||
func NewPusher(cache cache.MsgCache, client discoveryregistry.SvcDiscoveryRegistry, offlinePusher OfflinePusher) *Pusher {
|
||||
return &Pusher{
|
||||
cache: cache,
|
||||
client: client,
|
||||
|
||||
Reference in New Issue
Block a user