Skip to content

Commit

Permalink
noop param extractor exported
Browse files Browse the repository at this point in the history
  • Loading branch information
kpacha committed May 2, 2019
1 parent 21a8163 commit 733d40f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions router/mux/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ type RequestBuilder func(r *http.Request, queryString, headersToSend []string) *
// ParamExtractor is a function that extracts query params from the requested uri
type ParamExtractor func(r *http.Request) map[string]string

// NoopParamExtractor is a No Op ParamExtractor (returns an empty map of params)
func NoopParamExtractor(_ *http.Request) map[string]string { return map[string]string{} }

// NewRequest is a RequestBuilder that creates a proxy request from the received http request without
// processing the uri params
var NewRequest = NewRequestBuilder(func(_ *http.Request) map[string]string {
return map[string]string{}
})
var NewRequest = NewRequestBuilder(NoopParamExtractor)

// NewRequestBuilder gets a RequestBuilder with the received ParamExtractor as a query param
// extraction mechanism
Expand Down

0 comments on commit 733d40f

Please sign in to comment.