A simple arithmatic API with cache support written in Golang
$ go get -u github.com/Brettm12345/arithmatic
I use httpie for the following examples
$ arithmatic
$ http localhost:8080/add?x=4&y=5
{
"Action": "add",
"Answer": 9,
"Cached": false,
"X": 4,
"Y": 5
}
$ http localhost:8080/subtract?x=4&y=5
{
"action": "subtract",
"answer": -1,
"cached": false,
"x": 4,
"y": 5
}
$ http localhost:8080/subtract?x=4&y=5
{
"action": "multiply",
"answer": 20,
"cached": false,
"x": 4,
"y": 5
}
$ http localhost:8080/subtract?x=4&y=5
{
"action": "divide",
"answer": 0,
"cached": false,
"x": 4,
"y": 5
}