compiler/cpp/src/generate/t_go_generator.cc
/**
 * Generates a thrift service.
 *
 * @param tservice The service definition
 */
Generates a thrift service.
@param tservice The service definition
Generates a thrift service . @param tservice The service definition
void t_go_generator::generate_service(t_service* tservice) {
  string f_service_name = package_dir_+"/"+service_name_+".go";
  f_service_.open(f_service_name.c_str());
  f_service_ <<
    go_autogen_comment() <<
    go_package() <<
    go_imports();
  if (tservice->get_extends() != NULL) {
    f_service_ <<
      "import \"thriftlib/" << get_real_go_module(tservice->get_extends()->get_program()) << "\"" << endl;
  }
  f_service_ <<
                "import (" << endl <<
    indent() << "        \"os\"" << endl <<
    indent() << ")" << endl << endl <<
    render_fastbinary_includes();
  f_service_ << endl;
  generate_service_interface(tservice);
  generate_service_client(tservice);
  generate_service_server(tservice);
  generate_service_helpers(tservice);
  generate_service_remote(tservice);
  f_service_ << endl;
  f_service_.close();
}
void t_go_generator :: generate_service ( t_service * tservice ) { string f_service_name = package_dir_ + " " + service_name_ + " " ; f_service_ . open ( f_service_name . c_str ( ) ) ; f_service_ << go_autogen_comment ( ) << go_package ( ) << go_imports ( ) ; if ( tservice -> get_extends ( ) != NULL ) { f_service_ << " \" " << get_real_go_module ( tservice -> get_extends ( ) -> get_program ( ) ) << " \" " << endl ; } f_service_ << " " << endl << indent ( ) << " \" \" " << endl << indent ( ) << " " << endl << endl << render_fastbinary_includes ( ) ; f_service_ << endl ; generate_service_interface ( tservice ) ; generate_service_client ( tservice ) ; generate_service_server ( tservice ) ; generate_service_helpers ( tservice ) ; generate_service_remote ( tservice ) ; f_service_ << endl ; f_service_ . close ( ) ; }
Generates a thrift service.
Generates a thrift service .
// Generate the three main parts of the service (well, two for now in PHP) // Close service file