FizzBuzz

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

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

Go to latest
Published: Jun 1, 2023 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 ยถ

๐Ÿพ FizzBuzz

Technical Test submission for Leboncoin

Prerequisites

Having go installed -> https://go.dev/doc/install

If your already have what's needed : delete the executable FizzBuzz.

rm FizzBuzz

If not and you can't install it, you can use the executable : FizzBuzz

๐Ÿƒ Running project

Clone it (obviously) Create an .env from .env.example file if you want to specify either the ENV or SERVER_HTTP_PORT...

Compile and install

> go build
> ./FizzBuzz

Or, if you want to do it locally

> go run main.go

Workflow was integrated using builtIn GitHub tools.

(You could run it off of Docker, Kubernetes...)

... You're all set, the server is running on specified port ! (default :9000)

๐Ÿ›ฃ๏ธ Routes

3 routes here:

  • /health: check server status (running -> http code OK 200, not running -> 404)
  • /fizzbuzz:
    • Accepts five parameters: three integers int1, int2 and limit, and two strings str1 and str2.
      • Usage example: fizzbuzz?int1=3&int2=5&lim=100&str1=fizz&str2=buzz
      • Reminder : lim > str1, str2 and all of them must be greater than 0
  • /stats:
    • Return the parameters corresponding to the most used request(s), as well as the number of hits for this request"

๐Ÿ“ˆ Ways to improve

  • Did not go for TDD here, probably should have.
  • Makefile, Dockerfile or else
  • Connect to a real DB, use Squirrel
  • Front could be fancier ๐Ÿ™ƒ

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ ๆข็ฝ‘ๅ€