mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
3.6.1 code conventions (#2202)
* refactor: webhooks update. * Adjust configuration settings * Adjust configuration settings * Adjust configuration settings * feat: s3 api addr * refactor: webhooks update. * Adjust configuration settings * Adjust configuration settings * Adjust configuration settings * Adjust configuration settings * Adjust configuration settings * Adjust configuration settings * Adjust configuration settings * refactor: webhooks update. * refactor: kafka update. * Simplify the Docker Compose configuration, remove unnecessary environment variables, and eliminate the gateway service. * refactor: kafka update. * refactor: kafka update. * Simplify the Docker Compose configuration, remove unnecessary environment variables, and eliminate the gateway service. * Simplify the Docker Compose configuration, remove unnecessary environment variables, and eliminate the gateway service. * Windows can compile and run. * Windows can compile and run. * refactor: kafka update. * feat: msg cache split * refactor: webhooks update * refactor: webhooks update * refactor: friends update * refactor: group update * refactor: third update * refactor: api update * refactor: crontab update * refactor: msggateway update * mage * mage * refactor: all module update. * check * refactor: all module update. * load config * load config * load config * load config * refactor: all module update. * refactor: all module update. * refactor: all module update. * refactor: all module update. * refactor: all module update. * Optimize Docker configuration and script. * refactor: all module update. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * refactor: all module update. * Optimize Docker configuration and script. * refactor: all module update. * refactor: all module update. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * update tools * update tools * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * update protocol * Optimize Docker configuration and script. * Optimize Docker configuration and script. * refactor: all module update. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * Optimize Docker configuration and script. * refactor: api remove token auth by redis directly. * Code Refactoring * refactor: websocket auth change to call rpc of auth. * refactor: kick online user and remove token change to call auth rpc. * refactor: kick online user and remove token change to call auth rpc. * refactor: remove msggateway redis. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor webhook * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor webhook * refactor: cmd update. * refactor: cmd update. * fix: runtime: goroutine stack exceeds * refactor: cmd update. * refactor notification * refactor notification * refactor * refactor: cmd update. * refactor: cmd update. * refactor * refactor * refactor * protojson * protojson * protojson * go mod * wrapperspb * refactor: cmd update. * refactor: cmd update. * refactor: cmd update. * refactor: context update. * refactor: websocket update info. * refactor: websocket update info. * refactor: websocket update info. * refactor: websocket update info. * refactor: api name change. * refactor: debug info. * refactor: debug info. * refactor: debug info. * fix: update file * refactor * refactor * refactor: debug info. * refactor: debug info. * refactor: debug info. * refactor: debug info. * refactor: debug info. * refactor: debug info. * fix: callback update. * fix: callback update. * refactor * fix: update message. * fix: msg cache timeout. * refactor * refactor * fix: push update. * fix: push update. * fix: push update. * fix: push update. * fix: push update. * fix: push update. * refactor * refactor * fix: push update. * fix: websocket handle error remove when upgrade error. * fix: priority url * fix: minio config * refactor: add zk logger. * refactor * fix: minio config * refactor * refactor * refactor * refactor * refactor: remove zk logger. * refactor: update tools version. * refactor * refactor: update server version to 3.7.0. * refactor * refactor * refactor * refactor * refactor * refactor * refactor * refactor * refactor * refactor * refactor * refactor * refactor * refactor: zk log debug. * refactor: zk log debug. * refactor: zk log debug. * refactor: zk log debug. * refactor: zk log debug. * refactor * refactor * refactor * refactor: log level change. * refactor: 3.7.0 code conventions. --------- Co-authored-by: skiffer-git <44203734@qq.com> Co-authored-by: withchao <993506633@qq.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/openimsdk/tools/s3/cos"
|
||||
"github.com/openimsdk/tools/s3/minio"
|
||||
"github.com/openimsdk/tools/s3/oss"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -52,13 +53,11 @@ type Log struct {
|
||||
|
||||
type Minio struct {
|
||||
Bucket string `mapstructure:"bucket"`
|
||||
Port int `mapstructure:"port"`
|
||||
AccessKeyID string `mapstructure:"accessKeyID"`
|
||||
SecretAccessKey string `mapstructure:"secretAccessKey"`
|
||||
SessionToken string `mapstructure:"sessionToken"`
|
||||
InternalIP string `mapstructure:"internalIP"`
|
||||
ExternalIP string `mapstructure:"externalIP"`
|
||||
URL string `mapstructure:"url"`
|
||||
InternalAddress string `mapstructure:"internalAddress"`
|
||||
ExternalAddress string `mapstructure:"externalAddress"`
|
||||
PublicRead bool `mapstructure:"publicRead"`
|
||||
}
|
||||
|
||||
@@ -477,16 +476,24 @@ func (k *Kafka) Build() *kafka.Config {
|
||||
}
|
||||
}
|
||||
func (m *Minio) Build() *minio.Config {
|
||||
return &minio.Config{
|
||||
conf := minio.Config{
|
||||
Bucket: m.Bucket,
|
||||
Endpoint: fmt.Sprintf("http://%s:%d", m.InternalIP, m.Port),
|
||||
AccessKeyID: m.AccessKeyID,
|
||||
SecretAccessKey: m.SecretAccessKey,
|
||||
SessionToken: m.SessionToken,
|
||||
SignEndpoint: fmt.Sprintf("http://%s:%d", m.ExternalIP, m.Port),
|
||||
PublicRead: m.PublicRead,
|
||||
}
|
||||
|
||||
if _, _, err := net.SplitHostPort(m.InternalAddress); err == nil {
|
||||
conf.Endpoint = fmt.Sprintf("http://%s", m.InternalAddress)
|
||||
} else {
|
||||
conf.Endpoint = m.InternalAddress
|
||||
}
|
||||
if _, _, err := net.SplitHostPort(m.ExternalAddress); err == nil {
|
||||
conf.SignEndpoint = fmt.Sprintf("http://%s", m.ExternalAddress)
|
||||
} else {
|
||||
conf.SignEndpoint = m.ExternalAddress
|
||||
}
|
||||
return &conf
|
||||
}
|
||||
func (c *Cos) Build() *cos.Config {
|
||||
return &cos.Config{
|
||||
|
||||
@@ -31,6 +31,8 @@ func TestLoadOpenIMRpcUserConfig(t *testing.T) {
|
||||
var user User
|
||||
err := LoadConfig("../../../config/openim-rpc-user.yml", "IMENV_OPENIM_RPC_USER", &user)
|
||||
assert.Nil(t, err)
|
||||
//export IMENV_OPENIM_RPC_USER_RPC_LISTENIP="0.0.0.0"
|
||||
assert.Equal(t, "0.0.0.0", user.RPC.ListenIP)
|
||||
assert.Equal(t, []int{10110}, user.RPC.Ports)
|
||||
//export IMENV_OPENIM_RPC_USER_RPC_PORTS="10110,10111,10112"
|
||||
assert.Equal(t, []int{10110, 10111, 10112}, user.RPC.Ports)
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.6.0
|
||||
3.7.0
|
||||
@@ -33,6 +33,7 @@ const (
|
||||
func NewDiscoveryRegister(zookeeperConfig *config.ZooKeeper, share *config.Share) (discovery.SvcDiscoveryRegistry, error) {
|
||||
switch share.Env {
|
||||
case zookeeperConst:
|
||||
|
||||
return zookeeper.NewZkClient(
|
||||
zookeeperConfig.Address,
|
||||
zookeeperConfig.Schema,
|
||||
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
"hash/fnv"
|
||||
"unsafe"
|
||||
|
||||
"github.com/openimsdk/localcache/link"
|
||||
"github.com/openimsdk/localcache/lru"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/localcache/link"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/localcache/lru"
|
||||
)
|
||||
|
||||
type Cache[V any] interface {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
module github.com/openimsdk/localcache
|
||||
|
||||
go 1.19
|
||||
|
||||
require github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||
@@ -1 +0,0 @@
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/openimsdk/localcache/lru"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/localcache/lru"
|
||||
)
|
||||
|
||||
func defaultOption() *option {
|
||||
|
||||
@@ -17,9 +17,9 @@ package rpccache
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/openimsdk/localcache"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/cachekey"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/localcache"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
|
||||
pbconversation "github.com/openimsdk/protocol/conversation"
|
||||
"github.com/openimsdk/tools/errs"
|
||||
|
||||
@@ -17,9 +17,9 @@ package rpccache
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/openimsdk/localcache"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/cachekey"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/localcache"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
|
||||
"github.com/openimsdk/tools/log"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
@@ -17,9 +17,9 @@ package rpccache
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/openimsdk/localcache"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/cachekey"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/localcache"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
|
||||
"github.com/openimsdk/protocol/sdkws"
|
||||
"github.com/openimsdk/tools/errs"
|
||||
|
||||
@@ -17,9 +17,9 @@ package rpccache
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/openimsdk/localcache"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/cachekey"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/localcache"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/rpcclient"
|
||||
"github.com/openimsdk/protocol/sdkws"
|
||||
"github.com/openimsdk/tools/errs"
|
||||
|
||||
Reference in New Issue
Block a user