Move truss config to base /truss path and move main.go to /cmd/truss
This commit is contained in:
Родитель
3d4119b5d4
Коммит
193561cfe9
18
Makefile
18
Makefile
|
@ -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
|
Загрузка…
Ссылка в новой задаче