Skip to content

Commit

Permalink
UPDATE_SNAPSHOTS=true make test
Browse files Browse the repository at this point in the history
  • Loading branch information
izumin5210 committed Apr 12, 2018
1 parent 96fb07b commit 9a68c55
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package server
import (
"context"

"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 @@ -23,13 +21,3 @@ func NewBookServiceServer() interface {
type bookServiceServerImpl struct {
}

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

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

Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
package server

import (
"context"

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

api_pb "testapp/api"
)

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

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

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 NewBookServiceServer() interface {
type bookServiceServerImpl struct {
}

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

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

func (s *bookServiceServerImpl) ListBooks(ctx context.Context, req *api_pb.ListBooksRequest) (*api_pb.ListBooksResponse, error) {
// TODO: Not yet implemented.
return nil, status.Error(codes.Unimplemented, "TODO: You should implement it!")
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
package server

import (
"context"

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

api_pb "testapp/api"
)

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package server
import (
"context"

"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 @@ -23,13 +21,3 @@ func NewFooServiceServer() interface {
type fooServiceServerImpl struct {
}

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

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

Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
package server

import (
"context"

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

api_pb "testapp/api"
)

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package foo
import (
"context"

"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 @@ -23,13 +21,3 @@ func NewBarServiceServer() interface {
type barServiceServerImpl struct {
}

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarServiceServer(grpcSvr, s)
}

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

Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
package foo

import (
"context"

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

foo_pb "testapp/api/foo"
)

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarServiceServer(grpcSvr, s)
}

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

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package foo
import (
"context"

"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 @@ -23,13 +21,3 @@ func NewBarBazServiceServer() interface {
type barBazServiceServerImpl struct {
}

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barBazServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarBazServiceServer(grpcSvr, s)
}

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

Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
package foo

import (
"context"

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

foo_pb "testapp/api/foo"
)

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barBazServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarBazServiceServer(grpcSvr, s)
}

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

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 NewBarBazServiceServer() interface {
type barBazServiceServerImpl struct {
}

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barBazServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarBazServiceServer(grpcSvr, s)
}

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

func (s *barBazServiceServerImpl) ListBarBazs(ctx context.Context, req *foo_pb.ListBarBazsRequest) (*foo_pb.ListBarBazsResponse, error) {
// TODO: Not yet implemented.
return nil, status.Error(codes.Unimplemented, "TODO: You should implement it!")
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
package foo

import (
"context"

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

foo_pb "testapp/api/foo"
)

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barBazServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarBazServiceServer(grpcSvr, s)
}

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

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 NewBarBazServiceServer() interface {
type barBazServiceServerImpl struct {
}

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barBazServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarBazServiceServer(grpcSvr, s)
}

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

func (s *barBazServiceServerImpl) ListBarBazs(ctx context.Context, req *foo_pb.ListBarBazsRequest) (*foo_pb.ListBarBazsResponse, error) {
// TODO: Not yet implemented.
return nil, status.Error(codes.Unimplemented, "TODO: You should implement it!")
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
package foo

import (
"context"

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

foo_pb "testapp/api/foo"
)

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barBazServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarBazServiceServer(grpcSvr, s)
}

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

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package foo
import (
"context"

"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 @@ -23,13 +21,3 @@ func NewBarBazServiceServer() interface {
type barBazServiceServerImpl struct {
}

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barBazServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarBazServiceServer(grpcSvr, s)
}

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

Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
package foo

import (
"context"

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

foo_pb "testapp/api/foo"
)

// RegisterWithServer implements grapiserver.Server.RegisterWithServer.
func (s *barBazServiceServerImpl) RegisterWithServer(grpcSvr *grpc.Server) {
foo_pb.RegisterBarBazServiceServer(grpcSvr, s)
}

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

Loading

0 comments on commit 9a68c55

Please sign in to comment.