Skip to content

Commit ee1ab39

Browse files
authored
chore: copy helloworld proto service definitions to avoid import problems (#131)
1 parent 95cc6c7 commit ee1ab39

File tree

5 files changed

+365
-12
lines changed

5 files changed

+365
-12
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ require (
88
golang.org/x/sync v0.12.0
99
google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4
1010
google.golang.org/grpc v1.71.0
11-
google.golang.org/grpc/examples v0.0.0-20250318070318-1703656ba59e
1211
google.golang.org/protobuf v1.36.5
1312
)
1413

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 h1:
6666
google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I=
6767
google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
6868
google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
69-
google.golang.org/grpc/examples v0.0.0-20250318070318-1703656ba59e h1:KS7H8QNfKeIUnyj01PuYDiTzbTbTOFgGEXUYvb2ceZs=
70-
google.golang.org/grpc/examples v0.0.0-20250318070318-1703656ba59e/go.mod h1:BWjVN7LHAUVWTr33vu7vpxeTcNdLSsRJhj1aesSeUmk=
7169
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
7270
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
7371
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

grpc_unwrap_interceptors_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@ import (
99
"testing"
1010

1111
"github.com/pkg/errors"
12-
"google.golang.org/grpc/codes"
13-
1412
"github.com/stretchr/testify/assert"
1513
"github.com/stretchr/testify/require"
1614
"golang.org/x/sync/errgroup"
1715
"google.golang.org/grpc"
18-
"google.golang.org/grpc/examples/helloworld/helloworld"
16+
"google.golang.org/grpc/codes"
1917
"google.golang.org/grpc/status"
18+
19+
"github.com/ory/herodot/internal"
2020
)
2121

2222
type testingGreeter struct {
23-
helloworld.UnimplementedGreeterServer
23+
internal.UnimplementedGreeterServer
2424
shouldErr bool
2525
}
2626

27-
func (g *testingGreeter) SayHello(context.Context, *helloworld.HelloRequest) (*helloworld.HelloReply, error) {
27+
func (g *testingGreeter) SayHello(context.Context, *internal.HelloRequest) (*internal.HelloReply, error) {
2828
if g.shouldErr {
2929
return nil, errors.WithStack(ErrInternalServerError)
3030
}
31-
return &helloworld.HelloReply{Message: "see, no error"}, nil
31+
return &internal.HelloReply{Message: "see, no error"}, nil
3232
}
3333

3434
func TestGRPCInterceptors(t *testing.T) {
3535
server := &testingGreeter{}
3636
s := grpc.NewServer(grpc.UnaryInterceptor(UnaryErrorUnwrapInterceptor))
37-
helloworld.RegisterGreeterServer(s, server)
37+
internal.RegisterGreeterServer(s, server)
3838
l, err := net.Listen("tcp", "127.0.0.1:0")
3939
require.NoError(t, err)
4040

@@ -45,7 +45,7 @@ func TestGRPCInterceptors(t *testing.T) {
4545

4646
conn, err := grpc.Dial(l.Addr().String(), grpc.WithInsecure())
4747
require.NoError(t, err)
48-
c := helloworld.NewGreeterClient(conn)
48+
c := internal.NewGreeterClient(conn)
4949

5050
for _, tc := range []struct {
5151
name string
@@ -63,7 +63,7 @@ func TestGRPCInterceptors(t *testing.T) {
6363
t.Run("case="+tc.name, func(t *testing.T) {
6464
server.shouldErr = tc.shouldErr
6565

66-
resp, err := c.SayHello(context.Background(), &helloworld.HelloRequest{})
66+
resp, err := c.SayHello(context.Background(), &internal.HelloRequest{})
6767
if tc.shouldErr {
6868
assert.Equal(t, codes.Internal, status.Code(err))
6969
} else {

internal/helloworld.pb.go

Lines changed: 209 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)