增加单测和测试文件
This commit is contained in:
parent
f80576d8a8
commit
3ac08b5e9e
34
etc/goproxy.yaml
Normal file
34
etc/goproxy.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
flag: goproxy
|
||||
description: "包下载信息统计服务"
|
||||
domain: https://goproxy.cn/
|
||||
code_field: '-'
|
||||
message_field: '-'
|
||||
data_field: '-'
|
||||
success_code_list: []
|
||||
success_http_code_list:
|
||||
- 200
|
||||
api_table:
|
||||
package_info:
|
||||
description: "获取包的下载信息"
|
||||
flag: package_info
|
||||
uri: /stats/{{package_name}}
|
||||
method: GET
|
||||
bind_uri_param_list:
|
||||
- package_name
|
||||
timeout:
|
||||
read: 50000
|
||||
connect: 50000
|
||||
retry:
|
||||
connect_timeout: false
|
||||
read_timeout: false
|
||||
business_code_fail: false
|
||||
httpcodefail: false
|
||||
count: 0
|
||||
frequency: 0
|
||||
api_retry:
|
||||
connect_timeout: false
|
||||
read_timeout: false
|
||||
business_code_fail: false
|
||||
httpcodefail: false
|
||||
count: 0
|
||||
frequency: 0
|
@ -10,12 +10,11 @@ package rpc
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestInitRPC(t *testing.T) {
|
||||
proxyServiceInfo := &Service{
|
||||
/*proxyServiceInfo := &Service{
|
||||
Flag: "goproxy",
|
||||
Domain: "https://goproxy.cn/",
|
||||
CodeField: "-",
|
||||
@ -36,10 +35,8 @@ func TestInitRPC(t *testing.T) {
|
||||
},
|
||||
},
|
||||
ApiRetry: ApiRetry{},
|
||||
}
|
||||
if err := InitRPC(map[string]*Service{
|
||||
"goproxy": proxyServiceInfo,
|
||||
}, nil); nil != err {
|
||||
}*/
|
||||
if err := InitRPCFromCfgDir("/Users/zhangdeman/project/go-project/rpc/etc", nil); nil != err {
|
||||
panic(err.Error())
|
||||
}
|
||||
var result map[string]interface{}
|
||||
|
Loading…
Reference in New Issue
Block a user