matrix

command module
v0.0.0-...-030cd51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

README

Matrix

AppVeyor Build status codecov Go Report Card Quality Gate Status

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL