diff --git a/README.md b/README.md index 0fa757d..d4d5460 100644 --- a/README.md +++ b/README.md @@ -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 { diff --git a/pkg/rpc/request.go b/pkg/rpc/request.go index 845bf88..8e943ee 100644 --- a/pkg/rpc/request.go +++ b/pkg/rpc/request.go @@ -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")