stub

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	APIKey    string
	Processor func(w http.ResponseWriter, req *http.Request)
	Called    map[string]int
}

Server emulates a RapidAPI endpoint

func (*Server) Handle

func (server *Server) Handle(w http.ResponseWriter, req *http.Request)

Handle implements the RapidAPI endpoint. It validates that the x-rapidapi-key and then calls Handler.Processor. The endpoint "/slow" sleeps for 60 seconds, allowing timeout conditions to be tested.

Jump to

Keyboard shortcuts

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