微信接口的RPC包
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
497 B

  1. package weixinrpc
  2. const DES_KEY = "wxserrpc"
  3. type WxApiRes struct {
  4. Errcode string
  5. Errmsg string
  6. }
  7. type AccessTokenRes struct {
  8. AccessToken string
  9. ExpiresIn string
  10. WxApiRes
  11. }
  12. func rpc_server_conn(url ...string) (*WeixinRpcServiceClient, error) {
  13. var wx_rpc_url string = "127.0.0.1:7969"
  14. if len(url) > 0 && url[0] != "" {
  15. wx_rpc_url = url[0]
  16. }
  17. conn, _, err := DialWeixinRpcService("tcp", wx_rpc_url)
  18. if err != nil {
  19. return nil, err
  20. }
  21. defer conn.Close()
  22. return conn, nil
  23. }