Documentation
¶
Index ¶
- type ErrorMapping
- type HttpMethod
- type RequestBuilder
- type RequestConfiguration
- type RequestConfigurationOption
- func WithData(data interface{}) RequestConfigurationOption
- func WithErrorMapping(errorMapping ErrorMapping) RequestConfigurationOption
- func WithHeader[T any](header T) RequestConfigurationOption
- func WithQueryParameters[T any](queryParams T) RequestConfigurationOption
- func WithResponse(response Response) RequestConfigurationOption
- type RequestHeader
- type RequestInformation
- type RequestOption
- type RequestOptionKey
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorMapping ¶
type HttpMethod ¶
type HttpMethod int //nolint:stylecheck
Represents the HTTP method used by a request.
const ( // The HTTP GET method. GET HttpMethod = iota // The HTTP POST method. POST // The HTTP PATCH method. PATCH // The HTTP DELETE method. DELETE // The HTTP OPTIONS method. OPTIONS // The HTTP CONNECT method. CONNECT // The HTTP PUT method. PUT // The HTTP TRACE method. TRACE // The HTTP HEAD method. HEAD )
func (HttpMethod) String ¶
func (m HttpMethod) String() string
String returns the string representation of the HTTP method.
type RequestBuilder ¶
type RequestBuilder interface { SendDelete2(config *RequestConfiguration) error SendGet2(config *RequestConfiguration) error SendPost3(config *RequestConfiguration) error SendPut2(config *RequestConfiguration) error ToDeleteRequestInformation(params interface{}) (*RequestInformation, error) ToDeleteRequestInformation2(config *RequestConfiguration) (*RequestInformation, error) ToGetRequestInformation(params interface{}) (*RequestInformation, error) ToGetRequestInformation2(config *RequestConfiguration) (*RequestInformation, error) ToHeadRequestInformation() (*RequestInformation, error) ToPostRequestInformation(data map[string]string, params interface{}) (*RequestInformation, error) ToPostRequestInformation2(data interface{}, params interface{}) (*RequestInformation, error) ToPostRequestInformation3(config interface{}) (*RequestInformation, error) ToPutRequestInformation(data map[string]string, params interface{}) (*RequestInformation, error) ToPutRequestInformation2(config interface{}) (*RequestInformation, error) ToRequestInformation(method HttpMethod, data map[string]string, params interface{}) (*RequestInformation, error) ToRequestInformation2(method HttpMethod, rawData interface{}, params interface{}) (*RequestInformation, error) ToRequestInformation3(method HttpMethod, config *interface{}) (*RequestInformation, error) }
type RequestConfiguration ¶
type RequestConfiguration struct { Header interface{} QueryParameters interface{} Data interface{} ErrorMapping ErrorMapping Response Response }
func ApplyOptions ¶
func ApplyOptions(opts ...RequestConfigurationOption) *RequestConfiguration
ApplyOptions applies the given options to a RequestConfiguration.
type RequestConfigurationOption ¶
type RequestConfigurationOption func(*RequestConfiguration)
RequestConfigurationOption the functional option type for configuring requests.
func WithData ¶
func WithData(data interface{}) RequestConfigurationOption
WithData sets the data for the request.
func WithErrorMapping ¶
func WithErrorMapping(errorMapping ErrorMapping) RequestConfigurationOption
WithErrorMapping sets the error mapping for the request.
func WithHeader ¶
func WithHeader[T any](header T) RequestConfigurationOption
WithHeader sets the header for the request.
func WithQueryParameters ¶
func WithQueryParameters[T any](queryParams T) RequestConfigurationOption
WithQueryParameters sets the query parameters for the request.
func WithResponse ¶
func WithResponse(response Response) RequestConfigurationOption
WithResponse sets the response handler for the request.
type RequestHeader ¶
type RequestInformation ¶
type RequestInformation interface { SetStreamContent(content []byte) GetContent() []byte GetMethod() string GetHeaders() RequestHeader AddQueryParameters(source interface{}) error SetUri(url *url.URL) Url() (string, error) ToRequest() (*http.Request, error) ToRequestWithContext(ctx context.Context) (*http.Request, error) AddHeaders(rawHeaders interface{}) error }
type RequestOption ¶
type RequestOption interface { // GetKey returns the key to store the current option under. GetKey() RequestOptionKey }
Represents a request option.
type RequestOptionKey ¶
type RequestOptionKey struct { // The unique key for the option. Key string }
RequestOptionKey represents a key to store a request option under.
Click to show internal directories.
Click to hide internal directories.