# thriftgo **Repository Path**: cloudwego/thriftgo ## Basic Information - **Project Name**: thriftgo - **Description**: Thriftgo是thrift编译器在go语言中的一个实现。它有一个类似于apache/thrift编译器的命令行界面,并通过插件机制进行了增强,使其功能更加强大。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: https://www.cloudwego.io/ - **GVP Project**: No ## Statistics - **Stars**: 16 - **Forks**: 1 - **Created**: 2022-05-05 - **Last Updated**: 2024-10-27 ## Categories & Tags **Categories**: microservice **Tags**: None ## README thriftgo ======== **Thriftgo** is an implementation of [thrift](https://thrift.apache.org/docs/idl) compiler in go language. It has a command line interface similar to the apache/thrift compiler and is enhanced with a plugin mechanism which makes it more powerful. Installation ------------ Note: before executing the following commands, **make sure your `GOPATH` environment is properly set**. Using `go install`: `GO111MODULE=on go install github.com/cloudwego/thriftgo` Or build from source: ```shell git clone https://github.com/cloudwego/thriftgo.git cd thriftgo export GO111MODULE=on go mod tidy go build go install ``` Usage ----- The thriftgo command line tool accepts IDL files and compiles them to the target language. Each backend has a plentiful set of options to customize the generated code. By the moment, thriftgo can generates golang code only. More backends will be added in the future. To compile an thrift IDL to golang files with the default setting, you can just run: ```shell thriftgo -g go the-idl-file.thrift ``` Run `thriftgo -h` to see all available options for each backend and their meanings. Plugin ------ If the code generated by thriftgo does not satisfy your needs and the options provideds do not meet your requirements. You may also write plugins to generate code beside thriftgo while taking the advantage of thriftgo's IDL parser. Check the documentation of the plugin package for more details.