GithubHelp home page GithubHelp logo

redfox241 / supergo Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 121 KB

supergo 一个基于thrift的golang框架,支持go+go,php+go应用

License: Apache License 2.0

Makefile 0.07% Go 4.77% PHP 95.14% Shell 0.03%

supergo's Introduction

supergo 一个基于thrift的golang研发框架,支持go+go,php+go应用

目前主要是支持service端研发,不支持数据的api接口

#####一、使用生成工具生成demo

1、书写thrift文件(按照thrift语法)
	
	namespace go  demo.demo
	namespace php demo.demo
	
	
	/**
	  结构体定义
	 */
	struct DemoInfo{
		1:  i64 demo_id,
	    2:  string demo_name,
	}
	
	/*
	  service定义
	*/
	service Demo {
	    list<DemoInfo> GetDemoInfo(1:map<string, string> paramMap),
		i64 ProcessDemo(1: map<string,string> paramMap),
	}

2、使用demo生成工具生成demo
	
	cd tools
	sh genapptools.sh demo
		
		output
		|	demo
		|	|	bin
		|	|	pkg
		|__	|__	src
				|	Makefile    
				|	bin         
				|	client      
				|	clientphp   
				|	conf        
				|	controllers 
				|	libs        
				|	load        
				|	models      
				|	routers     
				|	service     
				|	utils
	*注意:支持根据thrift文件,多次生成demo,已经存在的code不受影响,支持增量
	
  3、编译
	make 
	启动server ./bin/go_server
	使用goclient测试 ./bin/go_client
	使用php测试  php ./clientphp/demo.php

supergo's People

Stargazers

redfox241 avatar

Watchers

James Cloos avatar redfox241 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.