mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge pull request #3033 from withchao/cherry-pick-a1b5f05
fix: resolving v3.8.3 conflicts
This commit is contained in:
commit
34c6fe5838
@ -38,3 +38,10 @@ object:
|
|||||||
accessKeySecret:
|
accessKeySecret:
|
||||||
sessionToken:
|
sessionToken:
|
||||||
publicRead: false
|
publicRead: false
|
||||||
|
aws:
|
||||||
|
region: ap-southeast-2
|
||||||
|
bucket: testdemo832234
|
||||||
|
accessKeyID:
|
||||||
|
secretAccessKey:
|
||||||
|
sessionToken:
|
||||||
|
publicRead: false
|
||||||
|
4
go.sum
4
go.sum
@ -317,8 +317,8 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
|||||||
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
|
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
|
||||||
github.com/onsi/gomega v1.25.0 h1:Vw7br2PCDYijJHSfBOWhov+8cAnUf8MfMaIOV323l6Y=
|
github.com/onsi/gomega v1.25.0 h1:Vw7br2PCDYijJHSfBOWhov+8cAnUf8MfMaIOV323l6Y=
|
||||||
github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM=
|
github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM=
|
||||||
github.com/openimsdk/gomake v0.0.15-alpha.2 h1:5Q8yl8ezy2yx+q8/ucU/t4kJnDfCzNOrkXcDACCqtyM=
|
github.com/openimsdk/gomake v0.0.14-alpha.5 h1:VY9c5x515lTfmdhhPjMvR3BBRrRquAUCFsz7t7vbv7Y=
|
||||||
github.com/openimsdk/gomake v0.0.15-alpha.2/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI=
|
github.com/openimsdk/gomake v0.0.14-alpha.5/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI=
|
||||||
github.com/openimsdk/protocol v0.0.72-alpha.70 h1:j7vB81+rTthijRda2b8tlli9oWvPxr4yXHwZ8nPZIBQ=
|
github.com/openimsdk/protocol v0.0.72-alpha.70 h1:j7vB81+rTthijRda2b8tlli9oWvPxr4yXHwZ8nPZIBQ=
|
||||||
github.com/openimsdk/protocol v0.0.72-alpha.70/go.mod h1:Iet+piS/jaS+kWWyj6EEr36mk4ISzIRYjoMSVA4dq2M=
|
github.com/openimsdk/protocol v0.0.72-alpha.70/go.mod h1:Iet+piS/jaS+kWWyj6EEr36mk4ISzIRYjoMSVA4dq2M=
|
||||||
github.com/openimsdk/tools v0.0.50-alpha.63 h1:dPoVvg4KWqYX/xtK3j96TwX2A/4jwT5S5XIHvSM9hTY=
|
github.com/openimsdk/tools v0.0.50-alpha.63 h1:dPoVvg4KWqYX/xtK3j96TwX2A/4jwT5S5XIHvSM9hTY=
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/openimsdk/tools/s3/aws"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -290,14 +291,7 @@ type Third struct {
|
|||||||
Cos Cos `mapstructure:"cos"`
|
Cos Cos `mapstructure:"cos"`
|
||||||
Oss Oss `mapstructure:"oss"`
|
Oss Oss `mapstructure:"oss"`
|
||||||
Kodo Kodo `mapstructure:"kodo"`
|
Kodo Kodo `mapstructure:"kodo"`
|
||||||
Aws struct {
|
Aws Aws `mapstructure:"aws"`
|
||||||
Endpoint string `mapstructure:"endpoint"`
|
|
||||||
Region string `mapstructure:"region"`
|
|
||||||
Bucket string `mapstructure:"bucket"`
|
|
||||||
AccessKeyID string `mapstructure:"accessKeyID"`
|
|
||||||
AccessKeySecret string `mapstructure:"accessKeySecret"`
|
|
||||||
PublicRead bool `mapstructure:"publicRead"`
|
|
||||||
} `mapstructure:"aws"`
|
|
||||||
} `mapstructure:"object"`
|
} `mapstructure:"object"`
|
||||||
}
|
}
|
||||||
type Cos struct {
|
type Cos struct {
|
||||||
@ -327,6 +321,15 @@ type Kodo struct {
|
|||||||
PublicRead bool `mapstructure:"publicRead"`
|
PublicRead bool `mapstructure:"publicRead"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Aws struct {
|
||||||
|
Endpoint string `mapstructure:"endpoint"`
|
||||||
|
Region string `mapstructure:"region"`
|
||||||
|
Bucket string `mapstructure:"bucket"`
|
||||||
|
AccessKeyID string `mapstructure:"accessKeyID"`
|
||||||
|
SecretAccessKey string `mapstructure:"secretAccessKey"`
|
||||||
|
SessionToken string `mapstructure:"sessionToken"`
|
||||||
|
}
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
RPC struct {
|
RPC struct {
|
||||||
RegisterIP string `mapstructure:"registerIP"`
|
RegisterIP string `mapstructure:"registerIP"`
|
||||||
@ -567,6 +570,16 @@ func (o *Kodo) Build() *kodo.Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o *Aws) Build() *aws.Config {
|
||||||
|
return &aws.Config{
|
||||||
|
Region: o.Region,
|
||||||
|
Bucket: o.Bucket,
|
||||||
|
AccessKeyID: o.AccessKeyID,
|
||||||
|
SecretAccessKey: o.SecretAccessKey,
|
||||||
|
SessionToken: o.SessionToken,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (l *CacheConfig) Failed() time.Duration {
|
func (l *CacheConfig) Failed() time.Duration {
|
||||||
return time.Second * time.Duration(l.FailedExpire)
|
return time.Second * time.Duration(l.FailedExpire)
|
||||||
}
|
}
|
||||||
@ -578,3 +591,115 @@ func (l *CacheConfig) Success() time.Duration {
|
|||||||
func (l *CacheConfig) Enable() bool {
|
func (l *CacheConfig) Enable() bool {
|
||||||
return l.Topic != "" && l.SlotNum > 0 && l.SlotSize > 0
|
return l.Topic != "" && l.SlotNum > 0 && l.SlotSize > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
DiscoveryConfigFilename = "discovery.yml"
|
||||||
|
KafkaConfigFileName = "kafka.yml"
|
||||||
|
LocalCacheConfigFileName = "local-cache.yml"
|
||||||
|
LogConfigFileName = "log.yml"
|
||||||
|
MinioConfigFileName = "minio.yml"
|
||||||
|
MongodbConfigFileName = "mongodb.yml"
|
||||||
|
OpenIMAPICfgFileName = "openim-api.yml"
|
||||||
|
OpenIMCronTaskCfgFileName = "openim-crontask.yml"
|
||||||
|
OpenIMMsgGatewayCfgFileName = "openim-msggateway.yml"
|
||||||
|
OpenIMMsgTransferCfgFileName = "openim-msgtransfer.yml"
|
||||||
|
OpenIMPushCfgFileName = "openim-push.yml"
|
||||||
|
OpenIMRPCAuthCfgFileName = "openim-rpc-auth.yml"
|
||||||
|
OpenIMRPCConversationCfgFileName = "openim-rpc-conversation.yml"
|
||||||
|
OpenIMRPCFriendCfgFileName = "openim-rpc-friend.yml"
|
||||||
|
OpenIMRPCGroupCfgFileName = "openim-rpc-group.yml"
|
||||||
|
OpenIMRPCMsgCfgFileName = "openim-rpc-msg.yml"
|
||||||
|
OpenIMRPCThirdCfgFileName = "openim-rpc-third.yml"
|
||||||
|
OpenIMRPCUserCfgFileName = "openim-rpc-user.yml"
|
||||||
|
RedisConfigFileName = "redis.yml"
|
||||||
|
ShareFileName = "share.yml"
|
||||||
|
WebhooksConfigFileName = "webhooks.yml"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (d *Discovery) GetConfigFileName() string {
|
||||||
|
return DiscoveryConfigFilename
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k *Kafka) GetConfigFileName() string {
|
||||||
|
return KafkaConfigFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lc *LocalCache) GetConfigFileName() string {
|
||||||
|
return LocalCacheConfigFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *Log) GetConfigFileName() string {
|
||||||
|
return LogConfigFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Minio) GetConfigFileName() string {
|
||||||
|
return MinioConfigFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Mongo) GetConfigFileName() string {
|
||||||
|
return MongodbConfigFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (n *Notification) GetConfigFileName() string {
|
||||||
|
return NotificationFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *API) GetConfigFileName() string {
|
||||||
|
return OpenIMAPICfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ct *CronTask) GetConfigFileName() string {
|
||||||
|
return OpenIMCronTaskCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mg *MsgGateway) GetConfigFileName() string {
|
||||||
|
return OpenIMMsgGatewayCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mt *MsgTransfer) GetConfigFileName() string {
|
||||||
|
return OpenIMMsgTransferCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *Push) GetConfigFileName() string {
|
||||||
|
return OpenIMPushCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *Auth) GetConfigFileName() string {
|
||||||
|
return OpenIMRPCAuthCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Conversation) GetConfigFileName() string {
|
||||||
|
return OpenIMRPCConversationCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *Friend) GetConfigFileName() string {
|
||||||
|
return OpenIMRPCFriendCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *Group) GetConfigFileName() string {
|
||||||
|
return OpenIMRPCGroupCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Msg) GetConfigFileName() string {
|
||||||
|
return OpenIMRPCMsgCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *Third) GetConfigFileName() string {
|
||||||
|
return OpenIMRPCThirdCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *User) GetConfigFileName() string {
|
||||||
|
return OpenIMRPCUserCfgFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *Redis) GetConfigFileName() string {
|
||||||
|
return RedisConfigFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Share) GetConfigFileName() string {
|
||||||
|
return ShareFileName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *Webhooks) GetConfigFileName() string {
|
||||||
|
return WebhooksConfigFileName
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user