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