Skip to content

Commit

Permalink
Merge pull request #33 from sapawarga/auth-proto
Browse files Browse the repository at this point in the history
#32 add auth service in grpc protocol
  • Loading branch information
setiadijoe authored Jun 29, 2021
2 parents af7382c + 2feb102 commit 313b660
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ clean:
rm -vf ./phonebook/*.pb.go
rm -vf ./video/*.pb.go
rm -vf ./userpost/*.pb.go
rm -vf ./auth/*.pb.go

proto: clean
@echo "--- Preparing proto output directories ---"
@mkdir -p ./phonebook
@mkdir -p ./video
@mkdir -p ./userpost
@mkdir -p ./auth
@cd ./phonebook && protoc *.proto --go_out=plugins=grpc:.
@cd ./video && protoc *.proto --go_out=plugins=grpc:.
@cd ./userpost && protoc *.proto --go_out=plugins=grpc:.
@cd ./auth && protoc *.proto --go_out=plugins=grpc:.
@echo "--- Finished generate proto file ---"
224 changes: 224 additions & 0 deletions auth/auth.pb.go

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

16 changes: 16 additions & 0 deletions auth/auth.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";
package auth;
option go_package="../auth";

service AuthHandler {
rpc DecodeToken(RequestDecodeToken) returns (ResponsesDecodeToken);
}

message RequestDecodeToken {}

message ResponsesDecodeToken {
int64 id = 1;
string username = 2;
string role_label = 3;
string last_login_at = 4;
}

0 comments on commit 313b660

Please sign in to comment.