Source File
request.go
Belonging Package
go.pact.im/x/httprange
package httprangeimport ()// HTTPRequestBuilder is a factory for [http.Request] instances.type HTTPRequestBuilder interface {// Build creates a new HTTP request for the given context.Build(context.Context) (*http.Request, error)}// HTTPRequestBuilderFunc is a function that implements [HTTPRequestBuilder]// interface.type HTTPRequestBuilderFunc func(context.Context) (*http.Request, error)// Build implements the [HTTPRequestBuilder] interface.func ( HTTPRequestBuilderFunc) ( context.Context) (*http.Request, error) {return ()}// HTTPRequest is an [HTTPRequestBuilder] implementation that wraps an existing// [http.Request].type HTTPRequest http.Request// Build returns a shallow copy of the request with the given context.// It implements the [HTTPRequestBuilder] interface.func ( *HTTPRequest) ( context.Context) (*http.Request, error) {return (*http.Request)().WithContext(), nil}func (, http.Header) http.Header {if == nil {return}= .Clone()maps.Copy(, )return}
The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64)