# README
go-json-rest-middleware-mimiclatency
Middleware to produce latency for Go-Json-Rest.
This is ideally used during development, to test how clients behave with high latency.
Installation
You can do the usual:
go get github.com/MrWaggel/go-json-rest-middleware-mimiclatency
Usage
Import
Add the following imports.
import (
"github.com/MrWaggel/go-json-rest-middleware-mimiclatency"
"time"
)
Add middleware
To add a delay of two seconds to your api requests.
api.Use(&mimiclatency.MimicLatencyMiddleWare{
Duration:time.Second * 2,
})
# Structs
MimicLatencyMiddleWare mimics latency on the server.