thriftgo

command module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

thriftgo

Thriftgo is an implementation of thrift 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 get:

GO111MODULE=on go get github.com/cloudwego/thriftgo

Or build from source:

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:

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package generator contains the generator implementation that manages backends.
Package generator contains the generator implementation that manages backends.
backend
Package backend defines the Backend interface for generators.
Package backend defines the Backend interface for generators.
golang
Package golang is the generator backend for golang.
Package golang is the generator backend for golang.
golang/extension/unknown
Package unknown provides definitions that work with the thriftgo `keep_unknown_fields` option.
Package unknown provides definitions that work with the thriftgo `keep_unknown_fields` option.
golang/templates
Package templates defines templates for generating golang codes.
Package templates defines templates for generating golang codes.
Package parser parses a thrift IDL file with its dependencies into an abstract syntax tree.
Package parser parses a thrift IDL file with its dependencies into an abstract syntax tree.
pkg
namespace
Package namespace implements a namespace to solve name collision.
Package namespace implements a namespace to solve name collision.
test
Package test provides some simple assertion functions to simplify unit tests.
Package test provides some simple assertion functions to simplify unit tests.
Package plugin defines the interface for implementing thriftgo plugins.
Package plugin defines the interface for implementing thriftgo plugins.
Package semantic contains semantic checking for AST parsed from a IDL.
Package semantic contains semantic checking for AST parsed from a IDL.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL