Skip to content

Commit

Permalink
Fix testing app
Browse files Browse the repository at this point in the history
  • Loading branch information
izumin5210 committed Apr 12, 2018
1 parent 43681e3 commit 447abde
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
12 changes: 0 additions & 12 deletions testing/app/server/library_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import (
"context"

"github.com/golang/protobuf/ptypes/empty"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/izumin5210/grapi/pkg/grapiserver"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

Expand All @@ -24,16 +22,6 @@ func NewLibraryServiceServer() interface {
type libraryServiceServerImpl struct {
}

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *libraryServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
api_pb.RegisterLibraryServiceServer(grpcSvr, s)
}

// RegisterWithHandler implements grapiserver.Server.RegisterWithHandler.
func (s *libraryServiceServerImpl) RegisterWithHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return api_pb.RegisterLibraryServiceHandler(ctx, mux, conn)
}

func (s *libraryServiceServerImpl) ListBooks(ctx context.Context, req *api_pb.ListBooksRequest) (*api_pb.ListBooksResponse, error) {
return &api_pb.ListBooksResponse{
Books: []*api_pb.Book{
Expand Down
20 changes: 20 additions & 0 deletions testing/app/server/library_server_register_funcs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package server

import (
"context"

"github.com/grpc-ecosystem/grpc-gateway/runtime"
"google.golang.org/grpc"

api_pb "github.com/izumin5210/grapi/testing/api"
)

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *libraryServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
api_pb.RegisterLibraryServiceServer(grpcSvr, s)
}

// RegisterWithHandler implements grapiserver.Server.RegisterWithHandler.
func (s *libraryServiceServerImpl) RegisterWithHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return api_pb.RegisterLibraryServiceHandler(ctx, mux, conn)
}

0 comments on commit 447abde

Please sign in to comment.