Skip to content

Commit

Permalink
Add external grpc wire support (#548)
Browse files Browse the repository at this point in the history
* add grpc wire

* cleanup file structure

* remove bin

* implement common wire library

* fix goroutines

* go mod tidy

* lint

* add tests

* add license
  • Loading branch information
alexmasi authored Jul 19, 2024
1 parent 1eb8cd5 commit 3929cc9
Show file tree
Hide file tree
Showing 14 changed files with 802 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ kne_cli/kne_cli
kne_cli/kne
controller/server/server
x/webhook/webhook
x/wire/client/client
x/wire/server/server
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ require (
github.com/wI2L/jsondiff v0.5.1
go.universe.tf/metallb v0.13.5
golang.org/x/oauth2 v0.14.0
golang.org/x/sync v0.5.0
google.golang.org/api v0.149.0
google.golang.org/grpc v1.61.0
google.golang.org/protobuf v1.33.0
Expand Down Expand Up @@ -136,7 +137,6 @@ require (
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
Expand Down
1 change: 1 addition & 0 deletions proto/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ package proto
//go:generate protoc --go_out=./topo --go_opt=paths=source_relative ./topo.proto
//go:generate protoc --go_out=./ceos --go_opt=paths=source_relative ./ceos.proto
//go:generate protoc --go_out=./controller --go-grpc_out=./controller --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative ./controller.proto
//go:generate protoc --go_out=./wire --go-grpc_out=./wire --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative ./wire.proto
//go:generate protoc --go_out=./event --go-grpc_out=./event --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative ./event.proto
30 changes: 30 additions & 0 deletions proto/wire.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2024 Google LLC
//
// 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.
syntax = "proto3";

package wire;

option go_package = "github.com/openconfig/kne/proto/wire";

// Wire service definition.
service Wire {
// Transmit sets up a bidirectional Packet stream.
// Metadata can be configured to identify the destination.
rpc Transmit(stream Packet) returns (stream Packet);
}

// Packet is a wrapper around bytes.
message Packet {
bytes data = 1;
}
163 changes: 163 additions & 0 deletions proto/wire/wire.pb.go

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

141 changes: 141 additions & 0 deletions proto/wire/wire_grpc.pb.go

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

Loading

0 comments on commit 3929cc9

Please sign in to comment.