fibAPI

command module
v0.0.0-...-a81adf3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

The Fibonacci API

This API exposes three endpoints that can be called via HTTP requests:

  • /current - returns the current number in the sequence
  • /next - returns the next number in the sequence
  • /previous - returns the previous number in the sequence

How it Works

go get -u github.com/smith4040/fibAPI

Run the fibAPI in the terminal or build and run with Docker.

Using Postman or your favorite API testing tool, send "GET" request to "http://localhost:8080/current", "http://localhost:8080/next" or "http://localhost:8080/previous".

About the API - Why choose...

gin-gonic/gin web framework was chosen due to its great performance, able to handle high throughput and minimalistic design. I went with the gin.Default implementation which handles the logging and recovery from panic.

stretchr/testify testing package was chosen to aid in testing the handlers with the assert function.

t-pwk/go-fibonacci package contains a benchmarked and tested Fibonacci function that is ideal for this project.

fvbock/endles router handles unexpected crashes of the router and automatically restarts.

A Dockerfile has been add to quickly run this application in a Docker container.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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