Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auto PR 🤖] Bump League Patch auto PR #472

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cmd/api/admin-api/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 OpenIM open source community. All rights reserved.

Check failure on line 1 in cmd/api/admin-api/main.go

View workflow job for this annotation

GitHub Actions / comment-language-detector

Lines [94]
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,6 @@
import (
"context"
"fmt"
"github.com/OpenIMSDK/chat/pkg/util"
"math/rand"
"net"
"net/http"
Expand All @@ -27,6 +26,10 @@
"syscall"
"time"

"github.com/OpenIMSDK/chat/pkg/util"

"github.com/OpenIMSDK/chat/pkg/util"

"github.com/OpenIMSDK/tools/errs"

"github.com/OpenIMSDK/chat/pkg/discovery_register"
Expand Down Expand Up @@ -79,7 +82,7 @@
}
var zk discoveryregistry.SvcDiscoveryRegistry
zk, err = discovery_register.NewDiscoveryRegister(config.Config.Envs.Discovery)
//zk, err = openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema,
// zk, err = openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema,
// openKeeper.WithFreq(time.Hour), openKeeper.WithUserNameAndPassword(config.Config.Zookeeper.Username, config.Config.Zookeeper.Password), openKeeper.WithRoundRobin(), openKeeper.WithTimeout(10), openKeeper.WithLogger(log.NewZkLogger()))
if err != nil {
util.ExitWithError(err)
Expand Down Expand Up @@ -126,5 +129,4 @@
close(netDone)
util.ExitWithError(netErr)
}

}
9 changes: 5 additions & 4 deletions cmd/api/chat-api/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 OpenIM open source community. All rights reserved.

Check failure on line 1 in cmd/api/chat-api/main.go

View workflow job for this annotation

GitHub Actions / comment-language-detector

Lines [94]
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,6 @@
"context"
"flag"
"fmt"
"github.com/OpenIMSDK/chat/pkg/util"
"net"
"net/http"
"os"
Expand All @@ -27,6 +26,10 @@
"syscall"
"time"

"github.com/OpenIMSDK/chat/pkg/util"

"github.com/OpenIMSDK/chat/pkg/util"

"github.com/OpenIMSDK/tools/errs"

"github.com/OpenIMSDK/chat/pkg/discovery_register"
Expand All @@ -46,7 +49,6 @@
)

func main() {

configFile, ginPort, showVersion, err := config.FlagParse()
if err != nil {
util.ExitWithError(err)
Expand Down Expand Up @@ -83,8 +85,7 @@
zk, err = discovery_register.NewDiscoveryRegister(config.Config.Envs.Discovery)
/*zk, err := openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Schema,
openKeeper.WithFreq(time.Hour), openKeeper.WithUserNameAndPassword(config.Config.Zookeeper.Username,
config.Config.Zookeeper.Password), openKeeper.WithRoundRobin(), openKeeper.WithTimeout(10), openKeeper.WithLogger(log.NewZkLogger()))*/
if err != nil {
config.Config.Zookeeper.Password), openKeeper.WithRoundRobin(), openKeeper.WithTimeout(10), openKeeper.WithLogger(log.NewZkLogger()))*/if err != nil {
util.ExitWithError(err)
}
if err := zk.CreateRpcRootNodes([]string{config.Config.RpcRegisterName.OpenImAdminName, config.Config.RpcRegisterName.OpenImChatName}); err != nil {
Expand Down
5 changes: 4 additions & 1 deletion cmd/rpc/admin-rpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ package main
import (
"flag"
"fmt"
"github.com/OpenIMSDK/chat/pkg/util"
"math/rand"
"time"

"github.com/OpenIMSDK/chat/pkg/util"

"github.com/OpenIMSDK/chat/pkg/util"

"github.com/OpenIMSDK/chat/pkg/common/chatrpcstart"
"github.com/OpenIMSDK/chat/pkg/common/version"
"github.com/OpenIMSDK/tools/log"
Expand Down
5 changes: 4 additions & 1 deletion cmd/rpc/chat-rpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ package main

import (
"fmt"
"github.com/OpenIMSDK/chat/pkg/util"
"math/rand"
"time"

"github.com/OpenIMSDK/chat/pkg/util"

"github.com/OpenIMSDK/chat/pkg/util"

"github.com/OpenIMSDK/chat/pkg/common/chatrpcstart"
"github.com/OpenIMSDK/tools/log"

Expand Down
29 changes: 14 additions & 15 deletions example/callback/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import (
"encoding/hex"
"encoding/json"
"errors"
"io"
"net/http"
"reflect"
"strings"
"time"

"github.com/OpenIMSDK/chat/pkg/common/apistruct"
"github.com/OpenIMSDK/chat/pkg/common/config"
"github.com/OpenIMSDK/chat/pkg/proto/admin"
Expand All @@ -17,11 +23,6 @@ import (
"github.com/OpenIMSDK/tools/log"
"github.com/OpenIMSDK/tools/utils"
"github.com/gin-gonic/gin"
"io"
"net/http"
"reflect"
"strings"
"time"
)

func CallbackExample(c *gin.Context) {
Expand Down Expand Up @@ -73,7 +74,7 @@ func CallbackExample(c *gin.Context) {
}
}

// struct to map
// struct to map.
func convertStructToMap(input interface{}) (map[string]interface{}, error) {
result := make(map[string]interface{})
inputType := reflect.TypeOf(input)
Expand All @@ -100,12 +101,11 @@ func convertStructToMap(input interface{}) (map[string]interface{}, error) {
}

func Post(ctx context.Context, url string, header map[string]string, data any, timeout int) (content []byte, err error) {
var (
// define http client.
client = &http.Client{
Timeout: 15 * time.Second, // max timeout is 15s
}
)

// define http client.
client := &http.Client{
Timeout: 15 * time.Second, // max timeout is 15s
}

if timeout > 0 {
var cancel func()
Expand Down Expand Up @@ -145,9 +145,8 @@ func Post(ctx context.Context, url string, header map[string]string, data any, t
return result, nil
}

// handlingCallbackAfterSendMsg Handling callbacks after sending a message
// handlingCallbackAfterSendMsg Handling callbacks after sending a message.
func handlingCallbackAfterSendMsg(c *gin.Context) (*apistruct.CallbackAfterSendSingleMsgReq, error) {

var req apistruct.CallbackAfterSendSingleMsgReq

if err := c.BindJSON(&req); err != nil {
Expand Down Expand Up @@ -200,7 +199,7 @@ func getAdminToken(c *gin.Context) (*apistruct.AdminLoginResp, error) {
return &apistruct.AdminLoginResp{AdminToken: adminOutput.Data.AdminToken, ImToken: adminOutput.Data.ImToken}, nil
}

// CheckRobotAccount Verify if the robot account exists
// CheckRobotAccount Verify if the robot account exists.
func getRobotAccountInfo(c *gin.Context, token, robotics string) (*common.UserPublicInfo, error) {
header := make(map[string]string)
header["token"] = token
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/OpenIMSDK/chat

go 1.21
toolchain go1.21.2

toolchain go1.21.2

require (
github.com/gin-gonic/gin v1.9.1
Expand Down
Loading
Loading