-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
330 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM golang:latest | ||
|
||
ENV APP ${GOPATH}/src/github.com/elafros/elafros/test/e2e/test_images/helloworld-grpc | ||
|
||
RUN mkdir -p "$APP" | ||
ADD . "$APP" | ||
RUN go get google.golang.org/grpc && \ | ||
go get golang.org/x/net/context | ||
|
||
WORKDIR "$APP" | ||
RUN go build -o /app/helloworld-grpc . | ||
CMD ["/app/helloworld-grpc"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"net" | ||
|
||
hello "github.com/elafros/elafros/test/e2e/test_images/helloworld-grpc/proto" | ||
"golang.org/x/net/context" | ||
"google.golang.org/grpc" | ||
) | ||
|
||
type helloServer struct { | ||
} | ||
|
||
func (s *helloServer) Hello(ctx context.Context, req *hello.Request) (*hello.Response, error) { | ||
return &hello.Response{Msg: fmt.Sprintf("Hello %s", req.Msg)}, nil | ||
} | ||
|
||
func main() { | ||
lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", 8080)) | ||
if err != nil { | ||
log.Fatalf("failed to listen: %v", err) | ||
} | ||
|
||
helloServer := &helloServer{} | ||
|
||
grpcServer := grpc.NewServer() | ||
hello.RegisterHelloServiceServer(grpcServer, helloServer) | ||
grpcServer.Serve(lis) | ||
} |
157 changes: 157 additions & 0 deletions
157
test/e2e/test_images/helloworld-grpc/proto/helloworld.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
test/e2e/test_images/helloworld-grpc/proto/helloworld.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
syntax = "proto3"; | ||
|
||
package hello; | ||
|
||
|
||
service HelloService { | ||
rpc Hello(Request) returns (Response) {} | ||
} | ||
|
||
message Request { | ||
string msg = 1; | ||
} | ||
|
||
message Response { | ||
string msg = 1; | ||
} | ||
|
Oops, something went wrong.