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 (發布於 )
用户参与
星數738
關注者數33
派生數144
提交數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.