alexluya / thrift4go Goto Github PK
View Code? Open in Web Editor NEWThis project forked from yanatan16/thrift4go
Apache Thrift for the Go Language
This project forked from yanatan16/thrift4go
Apache Thrift for the Go Language
The contents of this repository are now part of Apache Thrift as of version 0.7 or commit revision 1072478 (https://issues.apache.org/jira/browse/THRIFT-625). This project will continued to be maintained for any further developments for Thrift for Go as needed. Add this git repository to your thrift checkout. It will overwrite a few files to add options for Go. Currently generates code for the following protocols: 1) Binary Protocol (with test cases) 2) Fast Binary Protocol (with test cases) 3) Standard Thrift JSON Protocol (with test cases) 4) A (custom) simple JSON Protocol (with test cases) 5) Services (compiles and runs against Java, assumed to work elsewhere) Tested on Mac OS X 10.6 (Snow Leopard) To install in your Go Repository do: goinstall github.com/pomack/thrift4go/lib/go/thrift goinstall -a -log 4 files for thrift compiler (last tested on February 17, 2010): 1) configure.ac 2) lib/Makefile.am 3) compiler/cpp/Makefile.am 4) compiler/cpp/src/generate/t_go_generator.cc A tutorial has been created in the thrift4go/tutorial/go/src directory To use this tutorial, run thrift -r --gen go --gen java <thrift_src_dir>/tutorial/tutorial.thrift Build the files in the gen-go/ directory using gomake install Build the files in the <thrift_src_dir>/tutorial/go directory using gomake install Run the server from <thrift_src_dir>/tutorial/go/TutorialServerClient and run the client from either <thrift_src_dir>/tutorial/go/TutorialServerClient or gen-go/tutorial/Calculator/Calculator-remote Make sure you specify the same protocol for both the server and client Here's a basic walkthrough: thrift --gen go --gen java <thrift_src_dir>/test/ThriftTest.thrift this will create gen-go/thrift/test/*.go and associated files/directories * gen-go/thrift/test/ThriftTest.go shows a service and client base implementation with the associated interfaces and the ability to send/receive or serialize/deserialize as necessary. * ThriftTestClient is a client library designed to access the ThriftTest service. No changes would need to be made here. * A ThriftTest/ThriftTest-remote.go and associated Makefile is also made available so you can access a remote service implementing the ThriftTest interface and see how the client side works under the covers. The command-line arguments use the custom JSON parser, so you can just pass in JSON strings as arguments when you need to populate a struct, which I find better than any other alternative. * ThriftTestProcessor implements the server side and you would want to implement the server handlers using the function: NewThriftTestProcessor() * You just pass in your handler that implements the IThriftTest interface and make sure you import the appropriate package. Package directories/names are shown in the relevant Makefile. * One unique thing about Go is that to have a publicly available function/variable, the first letter has to be capitalized, so all exportable functions/variables have the first letter capitalized, but since the thrift files normally don't, they assume any serialization uses the capitalization found in the thrift file itself.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.