229bcf6bd4
Add example and update README.md |
||
---|---|---|
deftree | ||
example | ||
gendoc | ||
gengokit | ||
protoc-gen-truss-protocast | ||
svcdef | ||
truss | ||
vendor | ||
.gitignore | ||
.travis.yml | ||
DEVELOPING.md | ||
Dockerfile | ||
LICENSE.md | ||
Makefile | ||
README.md | ||
USAGE.md |
README.md
Truss
Truss handles the painful parts of services, freeing you to focus on the business logic.
Please note that Truss is currently pre-release software, and may change drastically with no notice. There is no versioning, no guarantees, no stability at this time. However, if you want to play around, make suggestions, or submit changes, we welcome issues and pull requests!
Install
Currently, there is no binary distribution of Truss, you must install from source.
To install this software, you must:
-
Install protocol buffers version 3 or greater. The easiest way is to download a release from the github releases and add the binary to your
$PATH
. Otherwise install from source. -
Of course, install the Go compiler and tools from https://golang.org/. See https://golang.org/doc/install for details.
-
Install the
protoc-gen-go
andproto
packages for Go. The simplest way is to rungo get -u github.com/golang/protobuf/{proto,protoc-gen-go}
The compiler plugin, protoc-gen-go, will be installed in
$GOPATH/bin
. It must be in your$PATH
for the protocol compiler,protoc
, to find it. -
Install Truss with
go get -u github.com/TuneLab/go-truss/...
Usage
Using Truss is easy. You define your service with gRPC and protoc buffers, and Truss uses that definition to create an entire service. You can even add http annotations for HTTP 1.1/JSON transport!
Then you open the handlers/server/server_handler.go
, add you business logic, and you're good to go.
Here is an example service definition: Echo Service
Try Truss for yourself on Echo Service to see the service that is generated:
truss example/echo.proto
See USAGE.md for more details.
Developing
See DEVELOPING.md for details.