This project is a spam assessment application based on Go programming language and gRPC. Users input the data they like to assess and send it to the server. After appplying assessment functions, the server respond the result back to the client.
-
Git clone this project
git clone https://github.com/tinahhhhh/go-grpc.git
-
Install Go from here
-
Install gRPC
go install google.golang.org/grpc/cmd/[email protected] go install google.golang.org/protobuf/cmd/[email protected] export PATH="$PATH:$(go env GOPATH)/bin"s
-
Install Protocol buffer compiler
apt install -y protobuf-compiler
-
Run the server (Please provide the url.)
go run server/main.go -url https:xxx
-
Run the client
go run client/main.go
-
Input the data you like to spam check in the client under the format "entity_type:entity_value".
e.g. user_id:xxx email:[email protected] ip: xx.xx.xx.xx
TODO: Use docker composer to make client and server contrainer comunicate. Use socat to execute STDIN to the client container. The following commands and server address in client code need to be modified according to docker network environment.
-
Modify the server/Dockerfile file (In the last line (#22)) by providing URL for the data source.
ENTRYPOINT cd /go/src/grpc-client && go run main.go -url https:xxx
-
Run the server (Please provide the url.)
cd server docker build . -t server docker run server -p 50051:50051
-
Run the client
cd client docker build . -t client docker run -i client -p 50051:50051
-
Input the data you like to spam check in the client under the format "entity_type:entity_value".
e.g. user_id:xxx email:[email protected] ip: xx.xx.xx.xx
cd server
go test