Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/husseinfo/gomplex
https://github.com/husseinfo/gomplex
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/husseinfo/gomplex
- Owner: Husseinfo
- Created: 2019-07-12T15:44:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-12T15:50:12.000Z (over 5 years ago)
- Last Synced: 2024-06-20T22:31:10.224Z (6 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gomplex
**Performs math operations on complex numbers**
## gRPC service
### Install protoc
`$ go get -u github.com/golang/protobuf/protoc-gen-go`### Generate gRPC code in GO
`protoc -I service service/complex.proto --go_out=plugins=grpc:service`### Build & run
`$ go build app/``$ ./app`
### Docker
Via docker cli
`$ docker run gomplex`Via docker compose `$ docker-compose up`
### Kubernetes
## Clients
### Go client
#### Checking complex number type
`$ go run clients/client.go`
```
Real part: 2
Imaginary part: -1
Type of
{
Real: 2.00
Imaginary: -1.00
}
is Complex
```### Python client
#### Installation
##### Install requirements
`$ pip3 install -r requirements.txt`##### Generate gRPC code
`$ python3 -m grpc_tools.protoc -Iservice --python_out=clients/ --grpc_python_out=clients/ service/service.proto`#### Running example
`$ python3 clients/client.py --number 1+j --number 2-3j`
`$ python3 clients/client.py --number 2-j --number=-1-4j --subtraction`## TO-DO