transform to gitea.zjmud.xyz
This commit is contained in:
parent
3324e49678
commit
9d5fb45249
4
main.go
4
main.go
@ -3,8 +3,8 @@ package v5sdkgo
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
. "github.com/phyer/v5sdkgo/rest"
|
||||
. "github.com/phyer/v5sdkgo/ws"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/rest"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws"
|
||||
|
||||
"log"
|
||||
"time"
|
||||
|
10
rest/rest.go
10
rest/rest.go
@ -6,7 +6,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
. "github.com/phyer/v5sdkgo/utils"
|
||||
"gitea.zjmud.xyz/phyer/v5sdkgo/utils"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
@ -186,10 +186,10 @@ func (this *RESTAPI) Run(ctx context.Context) (res *RESTAPIResult, err error) {
|
||||
}
|
||||
|
||||
// Sign and set request headers
|
||||
timestamp := IsoTime()
|
||||
preHash := PreHashString(timestamp, this.Method, uri, body)
|
||||
timestamp := utils.IsoTime()
|
||||
preHash := utils.PreHashString(timestamp, this.Method, uri, body)
|
||||
//log.Println("preHash:", preHash)
|
||||
sign, err := HmacSha256Base64Signer(preHash, this.ApiKeyInfo.SecKey)
|
||||
sign, err := utils.HmacSha256Base64Signer(preHash, this.ApiKeyInfo.SecKey)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@ -312,7 +312,7 @@ func (this *RESTAPI) PrintRequest(request *http.Request, body string, preHash st
|
||||
if this.ApiKeyInfo.SecKey != "" {
|
||||
fmt.Println(" Secret-Key: " + this.ApiKeyInfo.SecKey)
|
||||
}
|
||||
fmt.Println(" Request(" + IsoTime() + "):")
|
||||
fmt.Println(" Request(" + utils.IsoTime() + "):")
|
||||
fmt.Println("\tUrl: " + request.URL.String())
|
||||
fmt.Println("\tMethod: " + strings.ToUpper(request.Method))
|
||||
if len(request.Header) > 0 {
|
||||
|
@ -2,8 +2,8 @@ package ws
|
||||
|
||||
import (
|
||||
"errors"
|
||||
. "github.com/phyer/v5sdkgo/ws/wImpl"
|
||||
. "github.com/phyer/v5sdkgo/ws/wInterface"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws/wImpl"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws/wInterface"
|
||||
"log"
|
||||
"runtime/debug"
|
||||
)
|
||||
|
@ -5,7 +5,7 @@ package wImpl
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
. "github.com/phyer/v5sdkgo/utils"
|
||||
"gitea.zjmud.xyz/phyer/v5sdkgo/utils"
|
||||
)
|
||||
|
||||
// jrpc请求结构体
|
||||
@ -20,7 +20,7 @@ func (r JRPCReq) GetType() int {
|
||||
}
|
||||
|
||||
func (r JRPCReq) ToString() string {
|
||||
data, err := Struct2JsonString(r)
|
||||
data, err := utils.Struct2JsonString(r)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ package wImpl
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
. "github.com/phyer/v5sdkgo/utils"
|
||||
"gitea.zjmud.xyz/phyer/v5sdkgo/utils"
|
||||
)
|
||||
|
||||
// 客户端请求消息格式
|
||||
@ -20,7 +20,7 @@ func (r ReqData) GetType() int {
|
||||
}
|
||||
|
||||
func (r ReqData) ToString() string {
|
||||
data, err := Struct2JsonString(r)
|
||||
data, err := utils.Struct2JsonString(r)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
package wInterface
|
||||
|
||||
import (
|
||||
. "github.com/phyer/v5sdkgo/ws/wImpl"
|
||||
"gitea.zjmud.xyz/phyer/v5sdkgo/ws/wImpl"
|
||||
)
|
||||
|
||||
// 请求数据
|
||||
type WSParam interface {
|
||||
EventType() Event
|
||||
EventType() wImpl.Event
|
||||
ToMap() *map[string]string
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ package ws
|
||||
// go test ws_cli.go ws_op.go ws_contants.go utils.go ws_pub_channel.go ws_pub_channel_test.go ws_priv_channel.go ws_priv_channel_test.go ws_jrpc.go ws_jrpc_test.go ws_test_AddBookedDataHook.go -v
|
||||
import (
|
||||
"fmt"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/wImpl"
|
||||
"log"
|
||||
"testing"
|
||||
"time"
|
||||
. "v5sdk_go/ws/wImpl"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -5,9 +5,9 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
. "github.com/phyer/v5sdkgo/config"
|
||||
. "github.com/phyer/v5sdkgo/utils"
|
||||
. "github.com/phyer/v5sdkgo/ws/wImpl"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/config"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/utils"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws/wImpl"
|
||||
"log"
|
||||
"regexp"
|
||||
"runtime/debug"
|
||||
|
@ -2,7 +2,7 @@ package ws
|
||||
|
||||
import (
|
||||
"context"
|
||||
. "github.com/phyer/v5sdkgo/ws/wImpl"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws/wImpl"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
10
ws/ws_op.go
10
ws/ws_op.go
@ -3,11 +3,11 @@ package ws
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
. "github.com/phyer/v5sdkgo/config"
|
||||
. "github.com/phyer/v5sdkgo/rest"
|
||||
. "github.com/phyer/v5sdkgo/utils"
|
||||
. "github.com/phyer/v5sdkgo/ws/wImpl"
|
||||
. "github.com/phyer/v5sdkgo/ws/wInterface"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/config"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/rest"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/utils"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws/wImpl"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws/wInterface"
|
||||
"log"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -1,7 +1,7 @@
|
||||
package ws
|
||||
|
||||
import (
|
||||
. "github.com/phyer/v5sdkgo/ws/wImpl"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws/wImpl"
|
||||
)
|
||||
|
||||
/*
|
||||
|
@ -2,7 +2,7 @@ package ws
|
||||
|
||||
import (
|
||||
"errors"
|
||||
. "github.com/phyer/v5sdkgo/ws/wImpl"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws/wImpl"
|
||||
)
|
||||
|
||||
/*
|
||||
|
@ -3,7 +3,7 @@ package ws
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
. "github.com/phyer/v5sdkgo/ws/wImpl"
|
||||
. "gitea.zjmud.xyz/phyer/v5sdkgo/ws/wImpl"
|
||||
"log"
|
||||
"strings"
|
||||
"testing"
|
||||
|
@ -313,7 +313,6 @@ func TestGetInfoFromErrMsg(t *testing.T) {
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
func TestParseMessage(t *testing.T) {
|
||||
r := prework()
|
||||
@ -361,7 +360,6 @@ func TestSubscribeTBT(t *testing.T) {
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
func TestSubscribeBalAndPos(t *testing.T) {
|
||||
r := prework_pri(CROSS_ACCOUNT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user