Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dragosv/matrix
Matrix web server
https://github.com/dragosv/matrix
Last synced: about 1 month ago
JSON representation
Matrix web server
- Host: GitHub
- URL: https://github.com/dragosv/matrix
- Owner: dragosv
- License: mpl-2.0
- Created: 2021-07-30T20:24:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-09T16:36:26.000Z (about 3 years ago)
- Last Synced: 2024-10-16T15:44:26.080Z (3 months ago)
- Language: Go
- Size: 127 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Matrix
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#wip)
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/fpupql9ui12h73bt?svg=true)](https://ci.appveyor.com/project/dragosv/matrix)
[![codecov](https://codecov.io/gh/dragosv/matrix/branch/master/graph/badge.svg)](https://codecov.io/gh/dragosv/matrix)
[![Go Report Card](https://goreportcard.com/badge/github.com/dragosv/matrix)](https://goreportcard.com/report/github.com/dragosv/matrix)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dragosv_matrix&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dragosv_matrix)Basic web server written in GoLang that performs operations on a matrix
## Build and Run
To build and run the web server the following commands needs to executed at the terminal
```
go mod download
go mod verify
go build .
go run .
```## Api
The description of the API can be accessed while the server is running at http://localhost:8080/swagger/index.html### Echo
Return the matrix as a string in matrix format.```
curl -F 'file=@/path/matrix.csv' "localhost:8080/echo"// Expected output
1,2,3
4,5,6
7,8,9
```
### Invert
Return the matrix as a string in matrix format where the columns and rows are inverted
```
curl -F 'file=@/path/matrix.csv' "localhost:8080/invert"// Expected output
1,4,7
2,5,8
3,6,9
```
### Flatten
Return the matrix as a 1 line string, with values separated by commas.
```
curl -F 'file=@/path/matrix.csv' "localhost:8080/flatten"// Expected output
1,2,3,4,5,6,7,8,9
```
### Sum
Return the sum of the integers in the matrix. Will return bad request if the addition overflows.
```
curl -F 'file=@/path/matrix.csv' "localhost:8080/sum"// Expected output
45
```
### Multiply
Return the product of the integers in the matrix. Will return bad request if the multiplication overflows.
```
curl -F 'file=@/path/matrix.csv' "localhost:8080/multiply"// Expected output
362880
```## Organization
The http handlers are located in the handlers folder while the corresponding business commands are in the commands folder