修改初始化方法
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
func main() {
|
||||
// 初始化
|
||||
rpc.InitiateRequest("127.0.0.1", 9631, "/root/cert.pem")
|
||||
rpc.Initiate("127.0.0.1", 9631, "/root/cert.pem")
|
||||
// 获取设备详情
|
||||
result, err := rpc.GetDevice().GetDetail(10001)
|
||||
if err != nil {
|
||||
|
||||
@@ -61,8 +61,8 @@ func (r *Request) Send(methodName string, body any, responseBody any) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 初始化请求类
|
||||
func InitiateRequest(host string, port uint16, rootCertPath string) error {
|
||||
// 初始化
|
||||
func Initiate(host string, port uint16, rootCertPath string) error {
|
||||
rootCert, err := os.ReadFile(rootCertPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cert file read fail")
|
||||
|
||||
Reference in New Issue
Block a user