fix: add go format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/926/head
Xinwei Xiong(cubxxw-openim) 2 years ago
parent 4b8cd76ad0
commit 0a27b6e0a6
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE

@ -72,6 +72,7 @@ func newContext(respWriter http.ResponseWriter, req *http.Request) *UserConnCont
ConnID: utils.Md5(req.RemoteAddr + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))),
}
}
func newTempContext() *UserConnContext {
return &UserConnContext{
Req: &http.Request{URL: &url.URL{}},
@ -125,9 +126,11 @@ func (c *UserConnContext) GetOperationID() string {
func (c *UserConnContext) SetOperationID(operationID string) {
c.Req.URL.Query().Set(OperationID, operationID)
}
func (c *UserConnContext) GetToken() string {
return c.Req.URL.Query().Get(Token)
}
func (c *UserConnContext) SetToken(token string) {
c.Req.URL.RawQuery = Token + "=" + token
}

@ -197,8 +197,10 @@ func (ws *WsServer) sendUserOnlineInfoToOtherNode(ctx context.Context, client *C
continue
}
msgClient := msggateway.NewMsgGatewayClient(v)
_, err := msgClient.MultiTerminalLoginCheck(ctx, &msggateway.MultiTerminalLoginCheckReq{UserID: client.UserID,
PlatformID: int32(client.PlatformID), Token: client.token})
_, err := msgClient.MultiTerminalLoginCheck(ctx, &msggateway.MultiTerminalLoginCheckReq{
UserID: client.UserID,
PlatformID: int32(client.PlatformID), Token: client.token,
})
if err != nil {
log.ZWarn(ctx, "MultiTerminalLoginCheck err", err, "node", v.Target())
continue
@ -206,6 +208,7 @@ func (ws *WsServer) sendUserOnlineInfoToOtherNode(ctx context.Context, client *C
}
return nil
}
func (ws *WsServer) SetKickHandlerInfo(i *kickHandler) {
ws.kickHandlerChan <- i
}

@ -25,11 +25,12 @@ var (
addr = "127.0.0.1:9092"
)
var consumer sarama.Consumer
var producer sarama.SyncProducer
var (
consumer sarama.Consumer
producer sarama.SyncProducer
)
func init() {
//Producer
config := sarama.NewConfig() // Instantiate a sarama Config
config.Producer.Return.Successes = true // Whether to enable the successes channel to be notified after the message is sent successfully
@ -43,7 +44,7 @@ func init() {
}
producer = client
//Consumer
// Consumer
consumerT, err := sarama.NewConsumer([]string{addr}, sarama.NewConfig())
if err != nil {
fmt.Printf("fail to start consumer, err:%v\n", err)

@ -158,7 +158,7 @@ func GroupConversion() {
temp := time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC)
if val.NotificationUpdateTime.Equal(temp) {
results[i].NotificationUpdateTime = time.Now()
//fmt.Println(val.NotificationUpdateTime)
// fmt.Println(val.NotificationUpdateTime)
}
}
// Process query results
@ -220,7 +220,7 @@ func ChatLogsConversion() {
MysqlDb_v2.Limit(batchSize).Offset(offset).Find(&results)
// Process query results
fmt.Println("============================batch data===================", offset, batchSize)
//fmt.Println(results)
// fmt.Println(results)
MysqlDb_v3.Create(results)
fmt.Println("======================================================")
offset += batchSize

@ -17,8 +17,9 @@ package main
import (
"testing"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/stretchr/testify/assert"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
)
func TestCheckMysql(t *testing.T) {

@ -19,11 +19,13 @@ import (
"io"
"os"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/pkg/cli/genericclioptions"
cliflag "github.com/openimsdk/component-base/pkg/cli/flag"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/pkg/cli/genericclioptions"
cmdutil "github.com/OpenIMSDK/Open-IM-Server/tools/imctl/inernal/iamctl/cmd/util"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/cmd/color"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/cmd/completion"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/cmd/info"
@ -34,7 +36,6 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/cmd/secret"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/cmd/set"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/cmd/user"
cmdutil "github.com/OpenIMSDK/Open-IM-Server/tools/imctl/inernal/iamctl/cmd/util"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/cmd/validate"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/cmd/version"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/util/templates"

@ -48,13 +48,13 @@ Find more information at:
colorExample = templates.Examples(`
# Print supported foreground and background colors
iamctl color
imctl color
# Print supported colors by type
iamctl color -t fg-hi
imctl color -t fg-hi
# Print all supported colors
iamctl color -t all`)
imctl color -t all`)
availableTypes = []string{"fg", "fg-hi", "bg", "bg-hi", "base", "all"}

@ -22,10 +22,11 @@ import (
"github.com/golang-jwt/jwt/v4"
"github.com/spf13/cobra"
"github.com/marmotedu/iam/internal/pkg/middleware/auth"
cmdutil "github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/cmd/util"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/internal/imctl/util/templates"
"github.com/OpenIMSDK/Open-IM-Server/tools/imctl/pkg/cli/genericclioptions"
"github.com/marmotedu/iam/internal/pkg/middleware/auth"
)
const (

@ -68,4 +68,4 @@ func TestGetConfigValue(t *testing.T) {
}
})
}
}
}

Loading…
Cancel
Save