Enable all tests (fix #25)
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
package sprint_clientgrpc
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
jwt "github.com/go-kit/kit/auth/jwt"
|
||||
"github.com/go-kit/kit/endpoint"
|
||||
"github.com/go-kit/kit/log"
|
||||
grpctransport "github.com/go-kit/kit/transport/grpc"
|
||||
context "golang.org/x/net/context"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
|
||||
|
@@ -1,14 +1,17 @@
|
||||
package sprint_endpoints
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"fmt"
|
||||
|
||||
"github.com/go-kit/kit/endpoint"
|
||||
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
|
||||
context "golang.org/x/net/context"
|
||||
oldcontext "golang.org/x/net/context"
|
||||
)
|
||||
|
||||
var _ = endpoint.Chain
|
||||
var _ = fmt.Errorf
|
||||
var _ = context.Background
|
||||
|
||||
type StreamEndpoint func(server interface{}, req interface{}) (err error)
|
||||
|
||||
@@ -20,7 +23,7 @@ type Endpoints struct {
|
||||
GetSprintEndpoint endpoint.Endpoint
|
||||
}
|
||||
|
||||
func (e *Endpoints) AddSprint(ctx context.Context, in *pb.AddSprintRequest) (*pb.AddSprintResponse, error) {
|
||||
func (e *Endpoints) AddSprint(ctx oldcontext.Context, in *pb.AddSprintRequest) (*pb.AddSprintResponse, error) {
|
||||
out, err := e.AddSprintEndpoint(ctx, in)
|
||||
if err != nil {
|
||||
return &pb.AddSprintResponse{ErrMsg: err.Error()}, err
|
||||
@@ -28,7 +31,7 @@ func (e *Endpoints) AddSprint(ctx context.Context, in *pb.AddSprintRequest) (*pb
|
||||
return out.(*pb.AddSprintResponse), err
|
||||
}
|
||||
|
||||
func (e *Endpoints) CloseSprint(ctx context.Context, in *pb.CloseSprintRequest) (*pb.CloseSprintResponse, error) {
|
||||
func (e *Endpoints) CloseSprint(ctx oldcontext.Context, in *pb.CloseSprintRequest) (*pb.CloseSprintResponse, error) {
|
||||
out, err := e.CloseSprintEndpoint(ctx, in)
|
||||
if err != nil {
|
||||
return &pb.CloseSprintResponse{ErrMsg: err.Error()}, err
|
||||
@@ -36,7 +39,7 @@ func (e *Endpoints) CloseSprint(ctx context.Context, in *pb.CloseSprintRequest)
|
||||
return out.(*pb.CloseSprintResponse), err
|
||||
}
|
||||
|
||||
func (e *Endpoints) GetSprint(ctx context.Context, in *pb.GetSprintRequest) (*pb.GetSprintResponse, error) {
|
||||
func (e *Endpoints) GetSprint(ctx oldcontext.Context, in *pb.GetSprintRequest) (*pb.GetSprintResponse, error) {
|
||||
out, err := e.GetSprintEndpoint(ctx, in)
|
||||
if err != nil {
|
||||
return &pb.GetSprintResponse{ErrMsg: err.Error()}, err
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// Code generated by protoc-gen-gogo.
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: services/sprint/sprint.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
@@ -19,7 +19,7 @@ It has these top-level messages:
|
||||
*/
|
||||
package sprint
|
||||
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
@@ -37,16 +37,16 @@ var _ = math.Inf
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type AddSprintRequest struct {
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (m *AddSprintRequest) Reset() { *m = AddSprintRequest{} }
|
||||
func (m *AddSprintRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*AddSprintRequest) ProtoMessage() {}
|
||||
func (*AddSprintRequest) Descriptor() ([]byte, []int) { return fileDescriptorSprint, []int{0} }
|
||||
func (*AddSprintRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
func (m *AddSprintRequest) GetName() string {
|
||||
if m != nil {
|
||||
@@ -57,13 +57,13 @@ func (m *AddSprintRequest) GetName() string {
|
||||
|
||||
type AddSprintResponse struct {
|
||||
Sprint *Sprint `protobuf:"bytes,1,opt,name=sprint" json:"sprint,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"`
|
||||
}
|
||||
|
||||
func (m *AddSprintResponse) Reset() { *m = AddSprintResponse{} }
|
||||
func (m *AddSprintResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*AddSprintResponse) ProtoMessage() {}
|
||||
func (*AddSprintResponse) Descriptor() ([]byte, []int) { return fileDescriptorSprint, []int{1} }
|
||||
func (*AddSprintResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *AddSprintResponse) GetSprint() *Sprint {
|
||||
if m != nil {
|
||||
@@ -80,13 +80,13 @@ func (m *AddSprintResponse) GetErrMsg() string {
|
||||
}
|
||||
|
||||
type CloseSprintRequest struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (m *CloseSprintRequest) Reset() { *m = CloseSprintRequest{} }
|
||||
func (m *CloseSprintRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CloseSprintRequest) ProtoMessage() {}
|
||||
func (*CloseSprintRequest) Descriptor() ([]byte, []int) { return fileDescriptorSprint, []int{2} }
|
||||
func (*CloseSprintRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
|
||||
func (m *CloseSprintRequest) GetId() string {
|
||||
if m != nil {
|
||||
@@ -96,13 +96,13 @@ func (m *CloseSprintRequest) GetId() string {
|
||||
}
|
||||
|
||||
type CloseSprintResponse struct {
|
||||
ErrMsg string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"`
|
||||
}
|
||||
|
||||
func (m *CloseSprintResponse) Reset() { *m = CloseSprintResponse{} }
|
||||
func (m *CloseSprintResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CloseSprintResponse) ProtoMessage() {}
|
||||
func (*CloseSprintResponse) Descriptor() ([]byte, []int) { return fileDescriptorSprint, []int{3} }
|
||||
func (*CloseSprintResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
|
||||
|
||||
func (m *CloseSprintResponse) GetErrMsg() string {
|
||||
if m != nil {
|
||||
@@ -112,13 +112,13 @@ func (m *CloseSprintResponse) GetErrMsg() string {
|
||||
}
|
||||
|
||||
type GetSprintRequest struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (m *GetSprintRequest) Reset() { *m = GetSprintRequest{} }
|
||||
func (m *GetSprintRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetSprintRequest) ProtoMessage() {}
|
||||
func (*GetSprintRequest) Descriptor() ([]byte, []int) { return fileDescriptorSprint, []int{4} }
|
||||
func (*GetSprintRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
|
||||
|
||||
func (m *GetSprintRequest) GetId() string {
|
||||
if m != nil {
|
||||
@@ -129,13 +129,13 @@ func (m *GetSprintRequest) GetId() string {
|
||||
|
||||
type GetSprintResponse struct {
|
||||
Sprint *Sprint `protobuf:"bytes,1,opt,name=sprint" json:"sprint,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"`
|
||||
ErrMsg string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"`
|
||||
}
|
||||
|
||||
func (m *GetSprintResponse) Reset() { *m = GetSprintResponse{} }
|
||||
func (m *GetSprintResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetSprintResponse) ProtoMessage() {}
|
||||
func (*GetSprintResponse) Descriptor() ([]byte, []int) { return fileDescriptorSprint, []int{5} }
|
||||
func (*GetSprintResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
|
||||
|
||||
func (m *GetSprintResponse) GetSprint() *Sprint {
|
||||
if m != nil {
|
||||
@@ -152,15 +152,15 @@ func (m *GetSprintResponse) GetErrMsg() string {
|
||||
}
|
||||
|
||||
type Sprint struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
CreatedAt uint32 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
||||
CreatedAt uint32 `protobuf:"varint,2,opt,name=created_at,json=createdAt" json:"created_at,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Sprint) Reset() { *m = Sprint{} }
|
||||
func (m *Sprint) String() string { return proto.CompactTextString(m) }
|
||||
func (*Sprint) ProtoMessage() {}
|
||||
func (*Sprint) Descriptor() ([]byte, []int) { return fileDescriptorSprint, []int{6} }
|
||||
func (*Sprint) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
|
||||
|
||||
func (m *Sprint) GetId() string {
|
||||
if m != nil {
|
||||
@@ -331,11 +331,11 @@ var _SprintService_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "services/sprint/sprint.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("services/sprint/sprint.proto", fileDescriptorSprint) }
|
||||
func init() { proto.RegisterFile("services/sprint/sprint.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptorSprint = []byte{
|
||||
var fileDescriptor0 = []byte{
|
||||
// 290 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x52, 0x4d, 0x4b, 0xc3, 0x40,
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x4d, 0x4b, 0xc3, 0x40,
|
||||
0x10, 0x6d, 0xaa, 0x44, 0x32, 0xa5, 0xa5, 0x1d, 0x0f, 0xc6, 0xa8, 0x20, 0x8b, 0x14, 0x4f, 0x11,
|
||||
0xea, 0x2f, 0x68, 0x3d, 0x28, 0x88, 0x97, 0xb4, 0xf7, 0x12, 0xbb, 0x43, 0x09, 0xd8, 0x24, 0xee,
|
||||
0xac, 0xfe, 0x5f, 0xff, 0x89, 0xb0, 0xbb, 0xcd, 0x57, 0x8b, 0x27, 0x4f, 0xc9, 0xec, 0xbc, 0x7d,
|
||||
|
@@ -1,10 +1,11 @@
|
||||
package sprint_grpctransport
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"fmt"
|
||||
|
||||
grpctransport "github.com/go-kit/kit/transport/grpc"
|
||||
context "golang.org/x/net/context"
|
||||
oldcontext "golang.org/x/net/context"
|
||||
|
||||
endpoints "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/endpoints"
|
||||
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
|
||||
@@ -14,7 +15,8 @@ import (
|
||||
var _ = fmt.Errorf
|
||||
|
||||
func MakeGRPCServer(ctx context.Context, endpoints endpoints.Endpoints) pb.SprintServiceServer {
|
||||
options := []grpctransport.ServerOption{}
|
||||
var options []grpctransport.ServerOption
|
||||
_ = options
|
||||
return &grpcServer{
|
||||
|
||||
addsprint: grpctransport.NewServer(
|
||||
@@ -51,7 +53,7 @@ type grpcServer struct {
|
||||
getsprint grpctransport.Handler
|
||||
}
|
||||
|
||||
func (s *grpcServer) AddSprint(ctx context.Context, req *pb.AddSprintRequest) (*pb.AddSprintResponse, error) {
|
||||
func (s *grpcServer) AddSprint(ctx oldcontext.Context, req *pb.AddSprintRequest) (*pb.AddSprintResponse, error) {
|
||||
_, rep, err := s.addsprint.ServeGRPC(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -64,7 +66,7 @@ func encodeAddSprintResponse(ctx context.Context, response interface{}) (interfa
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *grpcServer) CloseSprint(ctx context.Context, req *pb.CloseSprintRequest) (*pb.CloseSprintResponse, error) {
|
||||
func (s *grpcServer) CloseSprint(ctx oldcontext.Context, req *pb.CloseSprintRequest) (*pb.CloseSprintResponse, error) {
|
||||
_, rep, err := s.closesprint.ServeGRPC(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -77,7 +79,7 @@ func encodeCloseSprintResponse(ctx context.Context, response interface{}) (inter
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *grpcServer) GetSprint(ctx context.Context, req *pb.GetSprintRequest) (*pb.GetSprintResponse, error) {
|
||||
func (s *grpcServer) GetSprint(ctx oldcontext.Context, req *pb.GetSprintRequest) (*pb.GetSprintResponse, error) {
|
||||
_, rep, err := s.getsprint.ServeGRPC(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package sprint_httptransport
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
context "golang.org/x/net/context"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
@@ -12,6 +12,10 @@ import (
|
||||
pb "github.com/moul/protoc-gen-gotemplate/examples/go-kit/services/sprint/gen/pb"
|
||||
)
|
||||
|
||||
var _ = log.Printf
|
||||
var _ = gokit_endpoint.Chain
|
||||
var _ = httptransport.NewClient
|
||||
|
||||
func MakeAddSprintHandler(ctx context.Context, svc pb.SprintServiceServer, endpoint gokit_endpoint.Endpoint) *httptransport.Server {
|
||||
return httptransport.NewServer(
|
||||
ctx,
|
||||
|
Reference in New Issue
Block a user