Skip to content

Commit

Permalink
⭐️ add example with oneof (#5)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hartmann <[email protected]>
  • Loading branch information
chris-rock authored Jul 17, 2022
1 parent 2d8fec6 commit bb4c736
Show file tree
Hide file tree
Showing 6 changed files with 542 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ install:
.PHONY: generate/examples
generate/examples:
go generate ./examples/pingpong
go generate ./examples/oneof

.PHONY: run/example/server
run/example/server: install generate/examples
Expand Down
4 changes: 4 additions & 0 deletions examples/oneof/oneof.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package oneof

// To regenerate the protocol buffer output for this package, run `go generate`
//go:generate protoc --go_out=. --go_opt=paths=source_relative --rangerrpc_out=. oneof.proto
289 changes: 289 additions & 0 deletions examples/oneof/oneof.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions examples/oneof/oneof.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";

package oneof;
option go_package = "go.mondoo.com/ranger-rpc/example/oneof";

message OneOfRequest {
oneof options {
string text = 1;
int64 number = 2;
}
}

message OneOfReply {
oneof options {
string text = 1;
int64 number = 2;
}
}

service OneOf {
rpc Echo (OneOfRequest) returns (OneOfReply);
}
Loading

0 comments on commit bb4c736

Please sign in to comment.