(transportFactory thrift.TTransportFactory, protocolFactory thrift.TProtocolFactory, addr string, secure bool, cfg *thrift.TConfiguration)
| 79 | } |
| 80 | |
| 81 | func runClient(transportFactory thrift.TTransportFactory, protocolFactory thrift.TProtocolFactory, addr string, secure bool, cfg *thrift.TConfiguration) error { |
| 82 | var transport thrift.TTransport |
| 83 | if secure { |
| 84 | transport = thrift.NewTSSLSocketConf(addr, cfg) |
| 85 | } else { |
| 86 | transport = thrift.NewTSocketConf(addr, cfg) |
| 87 | } |
| 88 | transport, err := transportFactory.GetTransport(transport) |
| 89 | if err != nil { |
| 90 | return err |
| 91 | } |
| 92 | defer transport.Close() |
| 93 | if err := transport.Open(); err != nil { |
| 94 | return err |
| 95 | } |
| 96 | iprot := protocolFactory.GetProtocol(transport) |
| 97 | oprot := protocolFactory.GetProtocol(transport) |
| 98 | return handleClient(tutorial.NewCalculatorClient(thrift.NewTStandardClient(iprot, oprot))) |
| 99 | } |
no test coverage detected