Skip to content

Commit

Permalink
Update xrpc
Browse files Browse the repository at this point in the history
  • Loading branch information
onanying committed Nov 9, 2023
1 parent 8b8163e commit aa1b432
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 536 deletions.
7 changes: 3 additions & 4 deletions src/xrpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ Add Import Paths: `$GOPATH`/src
## Best Practices

- .proto [style](https://protobuf.dev/programming-guides/style/#message-field-names)
- service name: `AppMessages` PascalCase
- method name: `SendMessage` PascalCase
- field Name: `string parse_mode = 1;` snake_case
- service name, rpc name, message name: `AppMessages` PascalCase
- message field name: `string parse_mode = 1;` snake_case
- urls:
- website url: `/send-message` kebab-case
- grpc gateway url: inner api: `/inner/send_message` snake_case
Expand Down Expand Up @@ -96,7 +95,7 @@ message SendResponse {
## Generate code

```
generate-go.sh
generate-pb.sh
```

## RPC Server
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions src/xrpc/generate-go.sh

This file was deleted.

10 changes: 10 additions & 0 deletions src/xrpc/generate-pb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -ex

BASEPATH=$(pwd)
GOPATH=$(go env GOPATH)
OUT=$BASEPATH
repos=$(find . -name "*.proto")
for FILE in $repos; do
protoc -I . -I `go env GOPATH`/src --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. --grpc-gateway_out=paths=source_relative:. $FILE
done
247 changes: 0 additions & 247 deletions src/xrpc/testdata/order.pb.go

This file was deleted.

Loading

0 comments on commit aa1b432

Please sign in to comment.