truss

module
v0.0.0-...-e7849b2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 License: MIT

README

Truss Build Status

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!

Everything all the time forever

Install

Currently, there is no binary distribution of Truss, you must install from source.

To install this software, you must:

  1. Install protoc 3 or newer. The easiest way is to download a release from github and add to $PATH. Otherwise install from source.

  2. Install the protoc-gen-go package (must be in $PATH).

    go get -u github.com/gogo/protobuf/protoc-gen-gogofast
    
  3. Install Truss with

    go get -u -d github.com/TuneLab/truss
    cd $GOPATH/src/github.com/TuneLab/truss
    make dependencies
    make
    

    On Windows, do the following instead:

    go get -u -d github.com/TuneLab/truss
    cd %GOPATH%/src/github.com/TuneLab/truss
    wininstall.bat
    

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/handlers.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 and TUTORIAL.md for more details.

Developing

See DEVELOPING.md for details.

Directories

Path Synopsis
_example
cmd
Deftree, which stands for "definition tree", creates a tree of nodes representing the components of a service defined through Protobuf definition files.
Deftree, which stands for "definition tree", creates a tree of nodes representing the components of a service defined through Protobuf definition files.
googlethirdparty
Package google_api is a generated protocol buffer package.
Package google_api is a generated protocol buffer package.
svcparse
Svcparse, which stands for "service parser" will parse the 'service' declarations within a provided protobuf and associate comments within that file with the various components of the service.
Svcparse, which stands for "service parser" will parse the 'service' declarations within a provided protobuf and associate comments within that file with the various components of the service.
Package gendoc is a truss plugin to generate markdown documentation for a protobuf definition file.
Package gendoc is a truss plugin to generate markdown documentation for a protobuf definition file.
clientarggen
Package clientarggen collects information for templating the code in a truss-generated client which marshals command line flags into message fields for each service.
Package clientarggen collects information for templating the code in a truss-generated client which marshals command line flags into message fields for each service.
generator
Package generator generates a gokit service based on a service definition.
Package generator generates a gokit service based on a service definition.
handlers
Package handlers manages the exported methods in the service handler code adding/removing exported methods to match the service definition.
Package handlers manages the exported methods in the service handler code adding/removing exported methods to match the service definition.
httptransport
Package httptransport provides functions and template helpers for templating the http-transport of a go-kit based service.
Package httptransport provides functions and template helpers for templating the http-transport of a go-kit based service.
template
This file is here to hold the `go generate` command above.
This file is here to hold the `go generate` command above.
Package svcdef provides a straightforward view of the Go code for a gRPC service defined using protocol buffers.
Package svcdef provides a straightforward view of the Go code for a gRPC service defined using protocol buffers.
execprotoc
Package execprotoc provides an interface for interacting with proto requiring only paths to files on disk
Package execprotoc provides an interface for interacting with proto requiring only paths to files on disk
parsesvcname
Package parsesvcname will parse the service name of a protobuf package.
Package parsesvcname will parse the service name of a protobuf package.

Jump to

Keyboard shortcuts

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