Documentation ¶
Overview ¶
Package api holds types, functions, methods for dispatching http requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
Api type defines what dependencies we need in order to fulfill http requests.
func New ¶
New returns a new Api instance that hoists all necessary dependencies to offer http server methods.
func (*Api) Current ¶
func (a *Api) Current(w http.ResponseWriter, r *http.Request)
Current returns the current fibonacci sequence for the http client.
func (*Api) Handler ¶
Handler returns a http.Handler ready for multiplexing requests to different endpoints.
type Fibonacci ¶
type Fibonacci interface { // Next takes a unique identifier to identify a caller and // returns the next fibonacci sequence number. Next(id string) string // Previous takes a unique identifier to identify a caller and // returns the previous fibonacci sequence number. Previous(id string) string // Current takes a unique identifier to identify a caller and // returns the current fibonacci sequence number. Current(id string) string }
Fibonacci defines how we generate fibonacci numbers for unique clients.
Click to show internal directories.
Click to hide internal directories.