Example of using nginx-ingress with gRPC
This commit is contained in:
parent
87d1b8bbf2
commit
e98e3f3b9d
15 changed files with 697 additions and 0 deletions
24
images/grpc-fortune-teller/proto/fortune/BUILD.bazel
Normal file
24
images/grpc-fortune-teller/proto/fortune/BUILD.bazel
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["doc.go"],
|
||||
embed = [":build_stack_fortune_go_proto"], # keep
|
||||
importpath = "github.com/kubernetes/ingress-nginx/images/grpc-fortune-teller/proto/fortune",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
proto_library(
|
||||
name = "build_stack_fortune_proto",
|
||||
srcs = ["fortune.proto"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_proto_library(
|
||||
name = "build_stack_fortune_go_proto",
|
||||
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
|
||||
importpath = "github.com/kubernetes/ingress-nginx/images/grpc-fortune-teller/proto/fortune",
|
||||
proto = ":build_stack_fortune_proto",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
18
images/grpc-fortune-teller/proto/fortune/doc.go
Normal file
18
images/grpc-fortune-teller/proto/fortune/doc.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package fortune acts as a placeholder f for generated *.pb.go files.
|
||||
package fortune
|
||||
14
images/grpc-fortune-teller/proto/fortune/fortune.proto
Normal file
14
images/grpc-fortune-teller/proto/fortune/fortune.proto
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package build.stack.fortune;
|
||||
|
||||
message PredictionRequest {
|
||||
}
|
||||
|
||||
message PredictionResponse {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
service FortuneTeller {
|
||||
rpc Predict(PredictionRequest) returns (PredictionResponse);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue