Documentation ¶
Overview ¶
Package web is a pretty basic web server at this point.
Manual Testing with curl:
curl --header "Content-Type: application/json" --request POST --data '{"username":"xyz","password":"xyz"}' http://localhost:8080/api/fred curl -X GET -H "Content-type: application/json" -H "Accept: application/json" "http://localhost:8080/api/fred"
Load Testing with vegeta
BaxterBot vegeta --addr http://10.41.45.222:8080 | vegeta attack -duration 10s | tee /tmp/report.bin | vegeta report -type=text && cat /tmp/report.bin | vegeta plot > /tmp/page.html && open /tmp/page.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
Start creates and starts an HTTP server on port 8080, or a different port if one is provided as an option.
Options that can be included are:
Port Sets the port that the http.Server will run on. RequestsPerSecond Sets the rate limiter to only allow a set amount of HTTP requests per second. Automatically sets the Burst to be 10% of the RequestsPerSecond value. Wait Uses the rate.Limiter Wait protocol instead of Allow.
Types ¶
Click to show internal directories.
Click to hide internal directories.