func NewTemplateContext(req *http.Request) *TemplateContext {
	var jsonBody map[string]interface{}
	if req.Body != nil {
		bodyBytes, _ := ioutil.ReadAll(req.Body)
		if err := json.Unmarshal(bodyBytes, &jsonBody); err != nil {
			log.Infof("could not coerce JSON out of req:%v", req.RequestURI)
		}
	}
	return &TemplateContext{
		Method:     &req.Method,
		Protocol:   &req.Proto,
		Host:       &req.Host,
		RemoteAddr: &req.RemoteAddr,
		Headers:    req.Header,
		Form:       req.Form,
		JsonBody:   jsonBody,
		PathVars:   pathVarsOrEmpty(req),
		Fake:       stableFake,
		uuid:       make([]byte, 16),  
	}
}
NewTemplateContext returns a pointer to TemplateContext
package mockaroo
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"math/rand"
	"net/http"
	"net/url"
	"github.com/gorilla/mux"
	fakeit "github.com/brianvoe/gofakeit/v6"
	log "github.com/sirupsen/logrus"
)
const nicePrime = 2011
var stableRandom = rand.New(rand.NewSource(nicePrime))
var stableFake = fakeit.New(nicePrime)
type TemplateContext struct {
	Method *string
	Protocol *string
	Host *string
	RemoteAddr *string
	Headers http.Header
	Form url.Values
	JsonBody map[string]interface{}
	PathVars map[string]string
	Fake *fakeit.Faker
	uuid []byte
}
func (tc *TemplateContext) NewUUID() string {
	stableRandom.Read(tc.uuid)
	return fmt.Sprintf("%x-%x-%x-%x-%x",
		tc.uuid[:4],
		tc.uuid[4:6],
		tc.uuid[6:8],
		tc.uuid[8:10],
		tc.uuid[10:])
}
func (tc *TemplateContext) PathVariable(key string) string {
	if tc.PathVars != nil && tc.PathVars[key] != "" {
		return tc.PathVars[key]
	}
	return ""
}
func (tc *TemplateContext) RandomInt(min, max int) int {
	return min + stableRandom.Intn(max-min)
}
func (tc *TemplateContext) RandomFloat(min, max float32) float32 {
	return min + (max-min)*stableRandom.Float32()
}