I have multiple HTTP handler being served using Golang HTTP server. For one of the handler I want that any moment only x client need to be served. Below is the sample code for the handler

// so I have a router
r := mux.NewRouter()

// and I have a route
api.Handle("/test", test.GetRequest).Methods("GET")
api.Handle("/test1", test1.PostRequest).Methods("POST")

I don't want to use rate limit as only /test need to have limited connections. How I can achieve the same. I am using Gorilla Mux package for serving HTTP request.

0 Answers