Move truss config to base /truss path and move main.go to /cmd/truss

This commit is contained in:
Adam Ryman 2016-11-08 22:39:10 -08:00
Родитель 3d4119b5d4
Коммит 193561cfe9
25 изменённых файлов: 21 добавлений и 47 удалений

Просмотреть файл

@ -3,6 +3,9 @@
# Build native Truss by default.
default: truss
dependencies:
go install github.com/golang/protobuf/protoc-gen-go
# Generate go files containing the all template files in []byte form
gobindata:
go generate github.com/TuneLab/go-truss/gengokit/template
@ -10,8 +13,8 @@ gobindata:
# Install truss and protoc-gen-truss-protocast
truss: gobindata
go install github.com/TuneLab/go-truss/protoc-gen-truss-protocast
go install github.com/TuneLab/go-truss/truss
go install github.com/TuneLab/go-truss/cmd/protoc-gen-truss-protocast
go install github.com/TuneLab/go-truss/cmd/truss
# Run the go tests and the truss integration tests
test: test-go test-integration
@ -20,13 +23,8 @@ test-go:
go test -v ./...
test-integration:
$(MAKE) -C truss test-integration
# Run the go non-vendored unit tests
test-nv:
go test -v ./deftree/... ./gendoc/... ./gengokit/... \
./protoc-gen-truss-protocast/... ./truss/...
$(MAKE) -C cmd/_integration-tests
# Removes generated code from tests
testclean:
$(MAKE) -C truss testclean
testclean:
$(MAKE) -C _integration-tests clean

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -38,7 +38,7 @@ func TestBasicTypes(t *testing.T) {
func TestBasicTypesWithPBOutFlag(t *testing.T) {
testEndToEnd("1-basic", t,
"-pbout",
"github.com/TuneLab/go-truss/truss/_integration-tests/cli/test-service-definitions/1-basic/pbout")
"github.com/TuneLab/go-truss/cmd/_integration-tests/cli/test-service-definitions/1-basic/pbout")
}
func TestMultipleFiles(t *testing.T) {

Просмотреть файл

@ -8,8 +8,8 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc"
pb "github.com/TuneLab/go-truss/truss/_integration-tests/transport/transport-service"
grpcclient "github.com/TuneLab/go-truss/truss/_integration-tests/transport/transport-service/generated/client/grpc"
pb "github.com/TuneLab/go-truss/cmd/_integration-tests/transport/transport-service"
grpcclient "github.com/TuneLab/go-truss/cmd/_integration-tests/transport/transport-service/generated/client/grpc"
)
var grpcAddr string

Просмотреть файл

@ -6,7 +6,7 @@ package handler
import (
"golang.org/x/net/context"
pb "github.com/TuneLab/go-truss/truss/_integration-tests/transport/transport-service"
pb "github.com/TuneLab/go-truss/cmd/_integration-tests/transport/transport-service"
)
// NewService returns a naïve, stateless implementation of Service.

Просмотреть файл

@ -14,8 +14,8 @@ import (
"golang.org/x/net/context"
// This Service
pb "github.com/TuneLab/go-truss/truss/_integration-tests/transport/transport-service"
httpclient "github.com/TuneLab/go-truss/truss/_integration-tests/transport/transport-service/generated/client/http"
pb "github.com/TuneLab/go-truss/cmd/_integration-tests/transport/transport-service"
httpclient "github.com/TuneLab/go-truss/cmd/_integration-tests/transport/transport-service/generated/client/http"
"github.com/pkg/errors"
)

Просмотреть файл

@ -14,9 +14,9 @@ import (
// Go Kit
"github.com/go-kit/kit/log"
pb "github.com/TuneLab/go-truss/truss/_integration-tests/transport/transport-service"
svc "github.com/TuneLab/go-truss/truss/_integration-tests/transport/transport-service/generated"
handler "github.com/TuneLab/go-truss/truss/_integration-tests/transport/transport-service/handlers/server"
pb "github.com/TuneLab/go-truss/cmd/_integration-tests/transport/transport-service"
svc "github.com/TuneLab/go-truss/cmd/_integration-tests/transport/transport-service/generated"
handler "github.com/TuneLab/go-truss/cmd/_integration-tests/transport/transport-service/handlers/server"
)
func TestMain(m *testing.M) {

Просмотреть файл

@ -1,6 +1,5 @@
# truss
The `truss` binary reads in gRPC files that define a single gRPC *service* and outputs:
1. Markdown and html documentation based on comments in the gRPC files.
@ -16,17 +15,3 @@ The `truss` binary reads in gRPC files that define a single gRPC *service* and o
- no-op handler methods for each *service* rpc, ready for marshalling command line arguments into a request object
4. An web based api explorer (through naive swagger generation)
## Install
```
$ go get -u -v github.com/TuneLab/go-truss/...
```
## Requirements
`truss` must:
- Be invoked from some directory within your `$GOPATH/src`
- Be passed `.proto` file paths that:
- Are withing the current directory

Просмотреть файл

@ -11,9 +11,9 @@ import (
"github.com/pkg/errors"
"github.com/TuneLab/go-truss/truss"
"github.com/TuneLab/go-truss/truss/execprotoc"
"github.com/TuneLab/go-truss/truss/parsepkgname"
"github.com/TuneLab/go-truss/truss/truss"
"github.com/TuneLab/go-truss/deftree"
"github.com/TuneLab/go-truss/gendoc"

Просмотреть файл

@ -4,7 +4,7 @@ package gendoc
import (
"github.com/TuneLab/go-truss/deftree"
"github.com/TuneLab/go-truss/truss/truss"
"github.com/TuneLab/go-truss/truss"
)
// GenerateDocs accepts a deftree that represents an ast of a group of

Просмотреть файл

@ -17,7 +17,7 @@ import (
templateFileAssets "github.com/TuneLab/go-truss/gengokit/template"
"github.com/TuneLab/go-truss/svcdef"
"github.com/TuneLab/go-truss/truss/truss"
"github.com/TuneLab/go-truss/truss"
)
func init() {

Просмотреть файл

@ -11,7 +11,7 @@ import (
"github.com/TuneLab/go-truss/gengokit/clientarggen"
"github.com/TuneLab/go-truss/gengokit/httptransport"
"github.com/TuneLab/go-truss/svcdef"
"github.com/TuneLab/go-truss/truss/truss"
"github.com/TuneLab/go-truss/truss"
)
type Renderable interface {

Просмотреть файл

@ -1,9 +0,0 @@
default:
$(MAKE) -C ..
test-integration: testclean
$(MAKE) -C _integration-tests
# Removes generated code from tests
testclean:
$(MAKE) -C _integration-tests clean

Просмотреть файл

Просмотреть файл