@ -36,8 +36,8 @@ var Config config
type CallBackConfig struct {
Enable bool ` yaml:"enable" `
CallbackTimeOut int ` yaml:" callbackTimeO ut"`
CallbackFailedContinue * bool ` yaml:" callbackF ailedContinue"`
CallbackTimeOut int ` yaml:" timeo ut"`
CallbackFailedContinue * bool ` yaml:" f ailedContinue"`
}
type NotificationConf struct {
@ -55,22 +55,81 @@ type POfflinePush struct {
}
type config struct {
ServerIP string ` yaml:"serverip" `
Zookeeper struct {
Schema string ` yaml:"schema" `
ZkAddr [ ] string ` yaml:"address" `
UserName string ` yaml:"userName" `
Password string ` yaml:"password" `
} ` yaml:"zookeeper" `
Mysql struct {
DBAddress [ ] string ` yaml:"address" `
DBUserName string ` yaml:"userName" `
DBPassword string ` yaml:"password" `
DBDatabaseName string ` yaml:"databaseName" `
DBMaxOpenConns int ` yaml:"maxOpenConns" `
DBMaxIdleConns int ` yaml:"maxIdleConns" `
DBMaxLifeTime int ` yaml:"maxLifeTime" `
LogLevel int ` yaml:"logLevel" `
SlowThreshold int ` yaml:"slowThreshold" `
} ` yaml:"mysql" `
Mongo struct {
DBUri string ` yaml:"uri" `
DBAddress [ ] string ` yaml:"address" `
DBTimeout int ` yaml:"timeout" `
DBDatabase string ` yaml:"database" `
DBSource string ` yaml:"source" `
DBUserName string ` yaml:"userName" `
DBPassword string ` yaml:"password" `
DBMaxPoolSize int ` yaml:"maxPoolSize" `
DBRetainChatRecords int ` yaml:"retainChatRecords" `
ChatRecordsClearTime string ` yaml:"chatRecordsClearTime" `
} ` yaml:"mongo" `
Redis struct {
DBAddress [ ] string ` yaml:"address" `
DBUserName string ` yaml:"userName" `
DBPassWord string ` yaml:"passWord" `
} ` yaml:"redis" `
Kafka struct {
SASLUserName string ` yaml:"SASLUserName" `
SASLPassword string ` yaml:"SASLPassword" `
Addr [ ] string ` yaml:"addr" `
LatestMsgToRedis struct {
Topic string ` yaml:"topic" `
} ` yaml:"latestMsgToRedis" `
OfflineMsgToMongoMysql struct {
Topic string ` yaml:"topic" `
} ` yaml:"offlineMsgToMongoMysql" `
MsqToPush struct {
Topic string ` yaml:"topic" `
} ` yaml:"msqToPush" `
MsgToModify struct {
Topic string ` yaml:"topic" `
} ` yaml:"msgToModify" `
ConsumerGroupID struct {
MsgToRedis string ` yaml:"msgToRedis" `
MsgToMongo string ` yaml:"msgToMongo" `
MsgToMySql string ` yaml:"msgToMySql" `
MsgToPush string ` yaml:"msgToPush" `
MsgToModify string ` yaml:"msgToModify" `
} ` yaml:"consumerGroupID" `
} ` yaml:"kafka" `
RpcRegisterIP string ` yaml:"rpcRegisterIP" `
Rpc struct {
RegisterIP string ` yaml:"registerIP" `
ListenIP string ` yaml:"listenIP" `
} ` yaml:"rpc" `
ServerVersion string ` yaml:"serverversion" `
Api struct {
GinPort [ ] int ` yaml:"openImApiPort" `
ListenIP string ` yaml:"listenIP" `
}
} ` yaml:"api" `
Sdk struct {
WsPort [ ] int ` yaml:"openImSdkWsPort" `
DataDir [ ] string ` yaml:"dataDir" `
}
Credential struct {
}
} ` yaml:"sdk" `
Object struct {
Enable string ` yaml:"enable" `
@ -90,7 +149,7 @@ type config struct {
Bucket string ` yaml:"bucket" `
SecretID string ` yaml:"secretID" `
SecretKey string ` yaml:"secretKey" `
}
} ` yaml:"tencent" `
Ali struct {
RegionID string ` yaml:"regionID" `
AccessKeyID string ` yaml:"accessKeyID" `
@ -101,7 +160,7 @@ type config struct {
FinalHost string ` yaml:"finalHost" `
StsDurationSeconds int64 ` yaml:"stsDurationSeconds" `
OssRoleArn string ` yaml:"OssRoleArn" `
}
} ` yaml:"ali" `
Aws struct {
AccessKeyID string ` yaml:"accessKeyID" `
AccessKeySecret string ` yaml:"accessKeySecret" `
@ -112,56 +171,10 @@ type config struct {
ExternalId string ` yaml:"externalId" `
RoleSessionName string ` yaml:"roleSessionName" `
} ` yaml:"aws" `
}
} ` yaml:"object" `
Mysql struct {
DBAddress [ ] string ` yaml:"dbMysqlAddress" `
DBUserName string ` yaml:"dbMysqlUserName" `
DBPassword string ` yaml:"dbMysqlPassword" `
DBDatabaseName string ` yaml:"dbMysqlDatabaseName" `
DBTableName string ` yaml:"DBTableName" `
DBMsgTableNum int ` yaml:"dbMsgTableNum" `
DBMaxOpenConns int ` yaml:"dbMaxOpenConns" `
DBMaxIdleConns int ` yaml:"dbMaxIdleConns" `
DBMaxLifeTime int ` yaml:"dbMaxLifeTime" `
LogLevel int ` yaml:"logLevel" `
SlowThreshold int ` yaml:"slowThreshold" `
}
Mongo struct {
DBUri string ` yaml:"dbUri" `
DBAddress [ ] string ` yaml:"dbAddress" `
DBDirect bool ` yaml:"dbDirect" `
DBTimeout int ` yaml:"dbTimeout" `
DBDatabase string ` yaml:"dbDatabase" `
DBSource string ` yaml:"dbSource" `
DBUserName string ` yaml:"dbUserName" `
DBPassword string ` yaml:"dbPassword" `
DBMaxPoolSize int ` yaml:"dbMaxPoolSize" `
DBRetainChatRecords int ` yaml:"dbRetainChatRecords" `
ChatRecordsClearTime string ` yaml:"chatRecordsClearTime" `
}
Redis struct {
DBAddress [ ] string ` yaml:"dbAddress" `
DBMaxIdle int ` yaml:"dbMaxIdle" `
DBMaxActive int ` yaml:"dbMaxActive" `
DBIdleTimeout int ` yaml:"dbIdleTimeout" `
DBUserName string ` yaml:"dbUserName" `
DBPassWord string ` yaml:"dbPassWord" `
EnableCluster bool ` yaml:"enableCluster" `
}
RpcPort struct {
OpenImUserPort [ ] int ` yaml:"openImUserPort" `
OpenImFriendPort [ ] int ` yaml:"openImFriendPort" `
OpenImMessagePort [ ] int ` yaml:"openImMessagePort" `
OpenImMessageGatewayPort [ ] int ` yaml:"openImMessageGatewayPort" `
OpenImGroupPort [ ] int ` yaml:"openImGroupPort" `
OpenImAuthPort [ ] int ` yaml:"openImAuthPort" `
OpenImPushPort [ ] int ` yaml:"openImPushPort" `
OpenImConversationPort [ ] int ` yaml:"openImConversationPort" `
OpenImCachePort [ ] int ` yaml:"openImCachePort" `
OpenImRtcPort [ ] int ` yaml:"openImRtcPort" `
OpenImThirdPort [ ] int ` yaml:"openImThirdPort" `
}
} ` yaml:"rpcPort" `
RpcRegisterName struct {
OpenImUserName string ` yaml:"openImUserName" `
OpenImFriendName string ` yaml:"openImFriendName" `
@ -173,91 +186,51 @@ type config struct {
OpenImConversationName string ` yaml:"openImConversationName" `
OpenImRtcName string ` yaml:"openImRtcName" `
OpenImThirdName string ` yaml:"openImThirdName" `
}
Zookeeper struct {
Schema string ` yaml:"schema" `
ZkAddr [ ] string ` yaml:"zkAddr" `
UserName string ` yaml:"userName" `
Password string ` yaml:"password" `
} ` yaml:"zookeeper" `
} ` yaml:"rpcRegisterName" `
Log struct {
StorageLocation string ` yaml:"storageLocation" `
RotationTime int ` yaml:"rotationTime" `
RemainRotationCount uint ` yaml:"remainRotationCount" `
RemainLogLevel int ` yaml:"remainLogLevel" `
IsStdout bool ` yaml:"isStdout" `
WithStack bool ` yaml:"withStack" `
IsJson bool ` yaml:"isJson" `
}
ModuleName struct {
LongConnSvrName string ` yaml:"longConnSvrName" `
MsgTransferName string ` yaml:"msgTransferName" `
PushName string ` yaml:"pushName" `
}
WithStack bool ` yaml:"withStack" `
} ` yaml:"log" `
LongConnSvr struct {
WebsocketPort [ ] int ` yaml:"openImWsPort" `
WebsocketMaxConnNum int ` yaml:"websocketMaxConnNum" `
WebsocketMaxMsgLen int ` yaml:"websocketMaxMsgLen" `
WebsocketTimeOut int ` yaml:"websocketTimeOut" `
}
} ` yaml:"longConnSvr" `
Push struct {
Jpns struct {
AppKey string ` yaml:"appKey" `
MasterSecret string ` yaml:"masterSecret" `
PushUrl string ` yaml:"pushUrl" `
PushIntent string ` yaml:"pushIntent" `
Enable bool ` yaml:"enable" `
}
Getui struct {
Enable string ` yaml:"enable" `
GeTui struct {
PushUrl string ` yaml:"pushUrl" `
AppKey string ` yaml:"appKey" `
Enable bool ` yaml:"enable" `
Intent string ` yaml:"intent" `
MasterSecret string ` yaml:"masterSecret" `
ChannelID string ` yaml:"channelID" `
ChannelName string ` yaml:"channelName" `
}
} ` yaml:"geTui" `
Fcm struct {
ServiceAccount string ` yaml:"serviceAccount" `
Enable bool ` yaml:"enable" `
}
} ` yaml:"fcm" `
Jpns struct {
AppKey string ` yaml:"appKey" `
MasterSecret string ` yaml:"masterSecret" `
PushUrl string ` yaml:"pushUrl" `
PushIntent string ` yaml:"pushIntent" `
} ` yaml:"jpns" `
}
Manager struct {
AppManagerUid [ ] string ` yaml:"appManagerUid" `
AppManagerU serID [ ] string ` yaml:"appManagerUserID "`
Nickname [ ] string ` yaml:"nickname" `
}
} ` yaml:"manager" `
Kafka struct {
SASLUserName string ` yaml:"SASLUserName" `
SASLPassword string ` yaml:"SASLPassword" `
Ws2mschat struct {
Addr [ ] string ` yaml:"addr" `
Topic string ` yaml:"topic" `
}
MsgToMongo struct {
Addr [ ] string ` yaml:"addr" `
Topic string ` yaml:"topic" `
}
Ms2pschat struct {
Addr [ ] string ` yaml:"addr" `
Topic string ` yaml:"topic" `
}
MsgToModify struct {
Addr [ ] string ` yaml:"addr" `
Topic string ` yaml:"topic" `
}
ConsumerGroupID struct {
MsgToRedis string ` yaml:"msgToTransfer" `
MsgToMongo string ` yaml:"msgToMongo" `
MsgToMySql string ` yaml:"msgToMySql" `
MsgToPush string ` yaml:"msgToPush" `
MsgToModify string ` yaml:"msgToModify" `
}
}
Secret string ` yaml:"secret" `
MultiLoginPolicy int ` yaml:"multiloginpolicy" `
ChatPersistenceMysql bool ` yaml:"chatpersistencemysql" `
MultiLoginPolicy int ` yaml:"multiLoginPolicy" `
ChatPersistenceMysql bool ` yaml:"chatPersistenceMysql" `
MsgCacheTimeout int ` yaml:"msgCacheTimeout" `
GroupMessageHasReadReceiptEnable bool ` yaml:"groupMessageHasReadReceiptEnable" `
SingleMessageHasReadReceiptEnable bool ` yaml:"singleMessageHasReadReceiptEnable" `
@ -265,32 +238,33 @@ type config struct {
TokenPolicy struct {
AccessSecret string ` yaml:"accessSecret" `
AccessExpire int64 ` yaml:"accessExpire" `
}
} ` yaml:"tokenPolicy" `
MessageVerify struct {
FriendVerify * bool ` yaml:"friendVerify" `
}
} ` yaml:"messageVerify" `
IOSPush struct {
PushSound string ` yaml:"pushSound" `
BadgeCount bool ` yaml:"badgeCount" `
Production bool ` yaml:"production" `
}
} ` yaml:"iosPush" `
Callback struct {
CallbackUrl string ` yaml:" callbackU rl"`
CallbackBeforeSendSingleMsg CallBackConfig ` yaml:" call backB eforeSendSingleMsg"`
CallbackAfterSendSingleMsg CallBackConfig ` yaml:" c allbackA fterSendSingleMsg"`
CallbackBeforeSendGroupMsg CallBackConfig ` yaml:" call backB eforeSendGroupMsg"`
CallbackAfterSendGroupMsg CallBackConfig ` yaml:" c allbackA fterSendGroupMsg"`
CallbackMsgModify CallBackConfig ` yaml:" callbackM sgModify"`
CallbackUserOnline CallBackConfig ` yaml:" callbackU serOnline"`
CallbackUserOffline CallBackConfig ` yaml:" callbackU serOffline"`
CallbackUserKickOff CallBackConfig ` yaml:" callbackU serKickOff"`
CallbackOfflinePush CallBackConfig ` yaml:" callbackO fflinePush"`
CallbackOnlinePush CallBackConfig ` yaml:" callbackO nlinePush"`
CallbackBeforeSuperGroupOnlinePush CallBackConfig ` yaml:" callbackS uperGroupOnlinePush"`
CallbackBeforeAddFriend CallBackConfig ` yaml:" call backB eforeAddFriend"`
CallbackBeforeCreateGroup CallBackConfig ` yaml:" call backB eforeCreateGroup"`
CallbackBeforeMemberJoinGroup CallBackConfig ` yaml:" call backB eforeMemberJoinGroup"`
CallbackBeforeSetGroupMemberInfo CallBackConfig ` yaml:" call backB eforeSetGroupMemberInfo"`
CallbackUrl string ` yaml:" u rl"`
CallbackBeforeSendSingleMsg CallBackConfig ` yaml:" beforeSendSingleMsg"`
CallbackAfterSendSingleMsg CallBackConfig ` yaml:" afterSendSingleMsg"`
CallbackBeforeSendGroupMsg CallBackConfig ` yaml:" beforeSendGroupMsg"`
CallbackAfterSendGroupMsg CallBackConfig ` yaml:" afterSendGroupMsg"`
CallbackMsgModify CallBackConfig ` yaml:" m sgModify"`
CallbackUserOnline CallBackConfig ` yaml:" u serOnline"`
CallbackUserOffline CallBackConfig ` yaml:" u serOffline"`
CallbackUserKickOff CallBackConfig ` yaml:" u serKickOff"`
CallbackOfflinePush CallBackConfig ` yaml:" o fflinePush"`
CallbackOnlinePush CallBackConfig ` yaml:" o nlinePush"`
CallbackBeforeSuperGroupOnlinePush CallBackConfig ` yaml:" s uperGroupOnlinePush"`
CallbackBeforeAddFriend CallBackConfig ` yaml:" beforeAddFriend"`
CallbackBeforeCreateGroup CallBackConfig ` yaml:" beforeCreateGroup"`
CallbackBeforeMemberJoinGroup CallBackConfig ` yaml:" beforeMemberJoinGroup"`
CallbackBeforeSetGroupMemberInfo CallBackConfig ` yaml:" beforeSetGroupMemberInfo"`
} ` yaml:"callback" `
Notification Notification ` yaml:"notification" `