站点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.

26 lines
458 B

3 years ago
3 years ago
  1. package siterpc
  2. import (
  3. "git.tetele.net/tgo/conf"
  4. )
  5. var DES_KEY = "confdata"
  6. func rpc_server_conn(url ...string) (*SiteServiceClient, error) {
  7. var rpc_url string
  8. if len(url) > 0 && url[0] != "" {
  9. rpc_url = url[0]
  10. } else if conf.SITE_RPC_URL != "" {
  11. rpc_url = conf.SITE_RPC_URL
  12. } else {
  13. rpc_url = "127.0.0.1:" + conf.SITE_RPC_PORT
  14. }
  15. conn, _, err := DialSiteService("tcp", rpc_url)
  16. if err != nil {
  17. return nil, err
  18. }
  19. return conn, nil
  20. }