Documentation
¶
Index ¶
Constants ¶
View Source
const ( FORMAT_STRING format = "String" FORMAT_JSON format = "JSON" )
View Source
const FORMAT_TYPE = "__FORMAT"
Variables ¶
This section is empty.
Functions ¶
func NewRequest ¶
Types ¶
type ProxiedRequest ¶
type ProxiedRequest interface {
// Adds the key-value pair to the header.
// It appends to any existing values associated with key
AddHeader(key string, value string) ProxiedRequest
// Applies the body to request replacing the older one if present
SetBody(body io.Reader) ProxiedRequest
// Set the key-value pair to the header.
// It replaces any existing values associated with key
SetHeader(key string, value string) ProxiedRequest
// Set the key-value pairs to the header.
// It replaces any existing values associated with the keys
SetHeaders(headers map[string]string) ProxiedRequest
// Transform the passed object into an io.Reader and applies it as body
// of the request, replacing the older one if present
SetJSONBody(body any) ProxiedRequest
// It allows to set comma separated values for the provided keys
// It replaces any existing values associated with the keys
SetMultiValueHeaders(headers map[string][]string) ProxiedRequest
// Adds an interceptor that is executed over the response
WithGenericInterceptor(handlers ...errorHandler) ProxiedRequest
// Adds an interceptor that is executed when the response status code
// matches the provided value
WithStatusCodeInterceptor(statusCode int, handlers ...errorHandler) ProxiedRequest
// Generates the underlying request without sending it. After this the request
// can't be modified or it will return an error
UnderlyingRequest() (*http.Request, error)
// Set the context of the request
WithContext(ctx context.Context) ProxiedRequest
// Generates the underlying request if not already generated and sends it
Send() (*http.Response, error)
}
Click to show internal directories.
Click to hide internal directories.