Specification https://github.com/OtusGolang/final_project/blob/master/01-anti-bruteforce.md
To run server execute command grpc, port specify by env var GRPC_PORT
GRPC_PORT=port ./antibruteforce grpc
If GRPC_PORT is missed port server will be started on port 50051
To run server in container do this.
make run
Port 50051 will be available for communicate with GRPC server.
Now you can build CLI client and run commands
Also you can specify port of GRPC server by env var GRPC_SERVER_HOST, if this var is missed it will be assumed that port is 50051
Example (default):
make build
./antibruteforce auth test 1234 193.192.170.13
Example (set vars):
make build
export GRPC_SERVER_HOST=localhost
export GRPC_SERVER_PORT=50052
./antibruteforce auth test 1234 193.192.170.13
add [flags] - Add IP into black or white list
delete [flags] - Delete ip from black of white list
clear --login= --password= --ip= [flags] - Clear bucket(s) for login, password or ip
auth [flags] - Check that auth is allowed for login, password and ip
Each command support --help option. Use it for explore details of commands
For run integration tests go to build/package and runmake test
For run unit tests run from the root of project and run
go test -v --race -tags unit ./...