endpoints

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoints

type Endpoints struct {
	// contains filtered or unexported fields
}

func NewEndpoints

func NewEndpoints(uc usecases.Usecases) *Endpoints

func (*Endpoints) FizzBuzz

func (gw *Endpoints) FizzBuzz(w http.ResponseWriter, r *http.Request)

FizzBuzz returns a string with numbers from 1 to limit where: all multiples of request.FizzModulo are replaced by request.FizzString, all multiples of request.BuzzModulo are replaced by request.BuzzString, all multiples of request.FizzModulo and request.BuzzModulo are replaced by FizzStringBuzzString returns 200 with fizzBuzz string if success returns 404 if modulus and limit are not present, not int, zero or negatives returns 500 if get an unexpected error

func (*Endpoints) Ping

func (gw *Endpoints) Ping(w http.ResponseWriter, r *http.Request)

Ping does not requires an usecase to optimize code

func (*Endpoints) RetrieveStats

func (gw *Endpoints) RetrieveStats(w http.ResponseWriter, r *http.Request)

RetrieveStats returns the FizzBuzz corresponding to most used requests, as well as the number of hits for those requests returns 200 with JSON response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳