Enable all tests (fix #25)

This commit is contained in:
Manfred Touron
2017-03-16 15:41:09 +01:00
parent 191df6c8ec
commit 97cfa60fc8
21 changed files with 123 additions and 86 deletions

View File

@@ -1,8 +1,9 @@
package {{.File.Package}}_clientgrpc
import (
"github.com/go-kit/kit/log"
context "golang.org/x/net/context"
context "context"
"github.com/go-kit/kit/log"
"google.golang.org/grpc"
grpctransport "github.com/go-kit/kit/transport/grpc"
"github.com/go-kit/kit/endpoint"

View File

@@ -3,9 +3,10 @@ package {{.File.Package}}_endpoints
{{$file := .File}}
import (
context "context"
"fmt"
context "golang.org/x/net/context"
oldcontext "golang.org/x/net/context"
pb "{{cat .GoPWD "/" .DestinationDir | nospace | clean}}/pb"
"github.com/go-kit/kit/endpoint"
)
@@ -43,7 +44,7 @@ type Endpoints struct {
return fmt.Errorf("not implemented")
}
{{else}}
func (e *Endpoints){{.Name}}(ctx context.Context, in *pb.{{.InputType | splitArray "." | last}}) (*pb.{{.OutputType | splitArray "." | last}}, error) {
func (e *Endpoints){{.Name}}(ctx oldcontext.Context, in *pb.{{.InputType | splitArray "." | last}}) (*pb.{{.OutputType | splitArray "." | last}}, error) {
out, err := e.{{.Name}}Endpoint(ctx, in)
if err != nil {
return &pb.{{.OutputType | splitArray "." | last}}{ErrMsg: err.Error()}, err

View File

@@ -3,9 +3,10 @@ package {{.File.Package}}_grpctransport
{{$file := .File}}
import (
context "context"
"fmt"
context "golang.org/x/net/context"
oldcontext "golang.org/x/net/context"
grpctransport "github.com/go-kit/kit/transport/grpc"
pb "{{cat .GoPWD "/" .DestinationDir | nospace | clean}}/pb"
@@ -57,7 +58,7 @@ type grpcServer struct {
return s.{{.Name | lower}}.Do(server, req)
}
{{else}}
func (s *grpcServer) {{.Name}}(ctx context.Context, req *pb.{{.InputType | splitArray "." | last}}) (*pb.{{.OutputType | splitArray "." | last}}, error) {
func (s *grpcServer) {{.Name}}(ctx oldcontext.Context, req *pb.{{.InputType | splitArray "." | last}}) (*pb.{{.OutputType | splitArray "." | last}}, error) {
_, rep, err := s.{{.Name | lower}}.ServeGRPC(ctx, req)
if err != nil {
return nil, err

View File

@@ -6,7 +6,7 @@ import (
"log"
"net/http"
"encoding/json"
context "golang.org/x/net/context"
"context"
pb "{{cat .GoPWD "/" .DestinationDir | nospace | clean}}/pb"
gokit_endpoint "github.com/go-kit/kit/endpoint"