-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addresses part of #1189
- Loading branch information
Showing
6 changed files
with
122 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ node_modules/ | |
./tusd | ||
tusd_*_* | ||
__pycache__/ | ||
venv/ | ||
examples/hooks/plugin/hook_handler | ||
.idea/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
hook_pb2.py: ../../../cmd/tusd/cli/hooks/proto/v2/hook.proto | ||
python3 -m grpc_tools.protoc --proto_path=../../../cmd/tusd/cli/hooks/proto/v2/ hook.proto --python_out=. --grpc_python_out=. | ||
hook_pb2.py: ../../../pkg/hooks/grpc/proto/hook.proto | ||
python3 -m grpc_tools.protoc --proto_path=../../../pkg/hooks/grpc/proto/ hook.proto --python_out=. --grpc_python_out=. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Example gRPC hook server with Python | ||
|
||
Use the following commands to run this example in a virtual environment: | ||
|
||
```sh | ||
# Setup virtual environment and install dependencies | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
pip3 install -r requirements.txt | ||
|
||
# Build gRPC code, if necessary | ||
make -B hook_pb2.py | ||
|
||
# Start gRPC server (listening at localhost:8000) | ||
python3 server.py | ||
|
||
# In a separate terminal you can now run tusd and point it to the gRPC server | ||
tusd -hooks-grpc localhost:8000 | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
grpcio==1.66.1 | ||
grpcio-tools==1.66.1 | ||
protobuf==5.28.2 | ||
setuptools==75.1.0 |