Truss

Truss 帮助你构建 go-kit golang 微服务,而不必担心编写或维护模板代码。「Truss helps you build go-kit microservices without having to worry about writing or maintaining boilerplate code.」

Github星跟踪图

Truss

Truss 处理了服务中令人头疼的部分,让你可以自由地专注于业务逻辑。

安装

目前,Truss 没有二进制发行版,你必须从源代码安装。

要安装这个软件,你必须:

  1. 安装 protoc 3 或更新版本。最简单的方法是从 github 下载一个版本 并添加到 $PATH。 否则 从源代码安装
  2. 使用如下方式安装 Truss
    go get -u -d github.com/metaverse/truss
    cd $GOPATH/src/github.com/metaverse/truss
    make dependencies
    make
    
    在 Windows 上,请执行以下操作:
    go get -u -d github.com/metaverse/truss
    cd %GOPATH%/src/github.com/metaverse/truss
    wininstall.bat
    

用法

使用 Truss 很容易。您可以使用 gRPC protoc 缓冲区 定义服务,Truss 使用该定义来创建整个服务。你甚至可以为 HTTP 1.1/JSON 传输添加 http 注解

然后打开 handlers / handlers.go ,添加你的业务逻辑,就可以了。

下面是一个服务定义的例子:Echo Service

自己在 Echo Service 上试试 Truss,看看生成的服务。

truss _example/echo.proto

有关详情,请参阅 USAGE.mdTUTORIAL.md for more details.

开发

有关详细信息,请参阅 DEVELOPING.md

主要指标

概览
名称与所有者metaverse/truss
主编程语言Go
编程语言Go (语言数: 5)
平台Linux, Mac, Windows
许可证Other
所有者活动
创建于2016-06-13 18:18:25
推送于2024-05-01 15:04:19
最后一次提交2022-10-20 11:44:52
发布数5
最新版本名称v0.3.1 (发布于 )
第一版名称v0.1.0 (发布于 )
用户参与
星数740
关注者数32
派生数146
提交数710
已启用问题?
问题数97
打开的问题数41
拉请求数213
打开的拉请求数7
关闭的拉请求数40
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

Truss Build Status

Truss handles the painful parts of services, freeing you to focus on the
business logic.

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 Truss with

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

    On Windows, do the following instead:

    go get -u -d github.com/metaverse/truss
    cd %GOPATH%/src/github.com/metaverse/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.