Skip to content

Commit

Permalink
Merge pull request #28 from Clarilab/middleware/add-grpc-middleware
Browse files Browse the repository at this point in the history
feat: add gRPC middleware
  • Loading branch information
nicoandrewss authored Jun 3, 2024
2 parents a0329e9 + 32d9a4a commit 84fde2e
Show file tree
Hide file tree
Showing 8 changed files with 732 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/examples/http",
},
{
"name": "GRPC Example",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/examples/grpc",
}
]
}
236 changes: 236 additions & 0 deletions examples/grpc/filetransfer/filetransfer.pb.go

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

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

package filetransfer;

option go_package = "./filetransfer";

// The service definition
service FileService {
// RPC to upload a file
rpc UploadFile(UploadFileRequest) returns (UploadFileResponse);
}

// The request message containing the file bytes
message UploadFileRequest {
string file_name = 1; // Name of the file being uploaded
bytes file_content = 2; // Contents of the file as bytes
}

// The response message confirming the upload
message UploadFileResponse {
bool success = 1; // Indicates if the upload was successful
string message = 2; // Additional message (e.g., error message)
}
111 changes: 111 additions & 0 deletions examples/grpc/filetransfer/filetransfer_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 84fde2e

Please sign in to comment.