Skip to content

Commit

Permalink
cicd: bump League Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kubbot committed Mar 27, 2024
1 parent 0d3afa4 commit ddc3999
Show file tree
Hide file tree
Showing 60 changed files with 198 additions and 113 deletions.
8 changes: 5 additions & 3 deletions cmd/api/admin-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package main
import (
"context"
"fmt"
"github.com/OpenIMSDK/chat/pkg/util"
"math/rand"
"net"
"net/http"
Expand All @@ -27,6 +26,10 @@ import (
"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 @@ func main() {
}
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 @@ func main() {
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
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"flag"
"fmt"
"github.com/OpenIMSDK/chat/pkg/util"
"net"
"net/http"
"os"
Expand All @@ -27,6 +26,10 @@ import (
"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 @@ import (
)

func main() {

configFile, ginPort, showVersion, err := config.FlagParse()
if err != nil {
util.ExitWithError(err)
Expand Down Expand Up @@ -83,8 +85,7 @@ func main() {
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

0 comments on commit ddc3999

Please sign in to comment.