Skip to content

Commit

Permalink
Addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anuptalwalkar committed Feb 14, 2017
1 parent e071aa8 commit 3711be4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
21 changes: 9 additions & 12 deletions modules/rpc/thriftrw-plugin-thriftsync/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
## Overview
[thriftsync] is a thriftrw plugin to identify and generate handlers for the given input
*.thrift file. With the use of thriftsync plugin, a user who needs to build a service should be able
to auto generate the code and write service specific logic without worrying about underlying platform.
*.thrift file. With the use of the thriftsync plugin, a user building a service should be able
to autogenerate the code and write service-specific logic without worrying about the underlying platform.

## Usage
Run `thriftsync` on any thrift file update to sync your handler code with the methods in the thrift file.
Run `thriftsync` to sync your handler code with the methods in the Thrift file.

*Install thriftsync from vendor:*
1. Install thriftsync from vendor
`go install ./vendor/go.uber.org/fx/modules/rpc/thriftrw-plugin-thriftsync`

*Run thriftrw code genration with thriftsync*
2. Run thriftrw code genration with thriftsync
`thriftrw --plugin="thriftsync --yarpc-server=<Import path of the yarpc servicenameserver>" <thrift filepath>`

Update your makefile with following lines and simply run `make thriftsync`
*Update makefile*
Update your makefile with the following lines, and run `make thriftsync`
3. Update makefile
```
deps:
@echo "Installing thriftrw..."
Expand All @@ -27,7 +27,7 @@ thriftsync: deps
```

## Example
Following examples show how `thriftsync` syncs handler code with the updated thrift file:
The following examples show how `thriftsync` syncs handler code with the updated Thrift file:

**New handler generation**

Expand All @@ -38,9 +38,6 @@ service TestService {
}
```

*Run thriftsync*
`thriftrw --plugin="thriftsync --yarpc-server=testservice/testservice/testserviceserver" testservice.thrift`

```go
package main

Expand Down Expand Up @@ -68,7 +65,7 @@ func (h *YARPCHandler) TestFunction(ctx context.Context, param *string) (string,
panic("To be implemented")
}
```
**New function added to thrift file**
**New function added to Thrift file**

```thrift
service TestService {
Expand Down
21 changes: 11 additions & 10 deletions modules/rpc/thriftrw-plugin-thriftsync/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,22 @@
// Package main is the Overview.
//
// [thriftsync] is a thriftrw plugin to identify and generate handlers for the given input
// *.thrift file. With the use of thriftsync plugin, a user who needs to build a service should be able
// to auto generate the code and write service specific logic without worrying about underlying platform.
// *.thrift file. With the use of the thriftsync plugin, a user building a service should be able
// to autogenerate the code and write service-specific logic without worrying about the underlying platform.
//
//
// Usage
//
// Run thriftsync on any thrift file update to sync your handler code with the methods in the thrift file.
// Run thriftsync to sync your handler code with the methods in the Thrift file.
//
// *Install thriftsync from vendor:*go install ./vendor/go.uber.org/fx/modules/rpc/thriftrw-plugin-thriftsync
// • Install thriftsync from vendor
// go install ./vendor/go.uber.org/fx/modules/rpc/thriftrw-plugin-thriftsync
//
// *Run thriftrw code genration with thriftsync*thriftrw --plugin="thriftsync --yarpc-server=<Import path of the yarpc servicenameserver>" <thrift filepath>
// • Run thriftrw code genration with thriftsync
// thriftrw --plugin="thriftsync --yarpc-server=<Import path of the yarpc servicenameserver>" <thrift filepath>
//
// Update your makefile with the following lines, and run make thriftsync3. Update makefile
//
// Update your makefile with following lines and simply run make thriftsync*Update makefile*
//
// deps:
// @echo "Installing thriftrw..."
Expand All @@ -47,7 +50,7 @@
//
// Example
//
// Following examples show how thriftsync syncs handler code with the updated thrift file:
// The following examples show how thriftsync syncs handler code with the updated Thrift file:
//
// **New handler generation**
//
Expand All @@ -56,8 +59,6 @@
// string testFunction(1: string param)
// }
//
// *Run thriftsync*thriftrw --plugin="thriftsync --yarpc-server=testservice/testservice/testserviceserver" testservice.thrift
//
// package main
//
// import (
Expand All @@ -84,7 +85,7 @@
// panic("To be implemented")
// }
//
// **New function added to thrift file**
// **New function added to Thrift file**
//
// service TestService {
// string testFunction(1: string param)
Expand Down

0 comments on commit 3711be4

Please sign in to comment.