mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 11:52:10 +08:00
Merge remote-tracking branch 'origin/3.6.1-code-conventions' into 3.6.1-code-conventions
This commit is contained in:
commit
7b66904062
@ -161,12 +161,6 @@ linters-settings:
|
||||
ignore-enum-members: ""
|
||||
# consider enums only in package scopes, not in inner scopes
|
||||
package-scope-only: false
|
||||
exhaustivestruct:
|
||||
struct-patterns:
|
||||
- '*.Test'
|
||||
- '*.Test2'
|
||||
- '*.Embedded'
|
||||
- '*.External'
|
||||
|
||||
forbidigo:
|
||||
# # Forbid the following identifiers (identifiers are written using regexp):
|
||||
|
||||
@ -18,8 +18,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
@ -28,6 +26,9 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/authverify"
|
||||
@ -52,11 +53,14 @@ import (
|
||||
|
||||
func Start(ctx context.Context, config *config.GlobalConfig, port int, proPort int) error {
|
||||
if port == 0 || proPort == 0 {
|
||||
err := errors.New("port or proPort is empty")
|
||||
wrappedErr := errs.WrapMsg(err, "validation error", "port", port, "proPort", proPort)
|
||||
wrappedErr := errs.WrapMsg(errors.New("port or proPort is empty"), "validation error", "port", port, "proPort", proPort)
|
||||
return wrappedErr
|
||||
}
|
||||
|
||||
// redisConfig := &config.Redis{
|
||||
|
||||
// }
|
||||
|
||||
rdb, err := cache.NewRedis(ctx, &config.Redis)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@ -63,6 +63,7 @@ type Zookeeper struct {
|
||||
Username string `yaml:"username"`
|
||||
Password string `yaml:"password"`
|
||||
}
|
||||
|
||||
type Mongo struct {
|
||||
Uri string `yaml:"uri"`
|
||||
Address []string `yaml:"address"`
|
||||
@ -71,6 +72,7 @@ type Mongo struct {
|
||||
Password string `yaml:"password"`
|
||||
MaxPoolSize int `yaml:"maxPoolSize"`
|
||||
}
|
||||
|
||||
type Redis struct {
|
||||
ClusterMode bool `yaml:"clusterMode"`
|
||||
Address []string `yaml:"address"`
|
||||
@ -78,6 +80,7 @@ type Redis struct {
|
||||
Password string `yaml:"password"`
|
||||
EnablePipeline bool `yaml:"enablePipeline"`
|
||||
}
|
||||
|
||||
type Kafka struct {
|
||||
Username string `yaml:"username"`
|
||||
Password string `yaml:"password"`
|
||||
|
||||
@ -74,6 +74,7 @@ func (cli *K8sDR) GetConfFromRegistry(key string) ([]byte, error) {
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (cli *K8sDR) GetUserIdHashGatewayHost(ctx context.Context, userId string) (string, error) {
|
||||
host, err := cli.gatewayHostConsistent.Get(userId)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user