Documentation
¶
Index ¶
- func NewDispatcher(client Client) (fiber.Dispatcher, error)
- func NewHTTPResponse(httpResponse *http.Response) fiber.Response
- type Client
- type Dispatcher
- type Handler
- type Options
- type Request
- type Response
- func (r *Response) BackendName() string
- func (r *Response) Header() http.Header
- func (r *Response) IsSuccess() bool
- func (r *Response) Label(key string) []string
- func (r *Response) StatusCode() int
- func (r *Response) WithBackendName(backEnd string) fiber.Response
- func (r *Response) WithLabel(key string, values ...string) fiber.Response
- func (r *Response) WithLabels(labels fiber.Labels) fiber.Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDispatcher ¶
func NewDispatcher(client Client) (fiber.Dispatcher, error)
Types ¶
type Client ¶
Client is the base interface for an http-client (to be able to mock actual implementation)
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
type Handler ¶
Handler is a structure used to capture a fiber component and a set of options for making requests
func NewHandler ¶
NewHandler is a creator factory for the Handler
func (*Handler) DoRequest ¶
func (h *Handler) DoRequest(httpReq *http.Request) (fiber.Response, *fiberErrors.FiberError)
DoRequest executes the given http request and returns the response / error
type Options ¶
Options captures a set of options that can be used as configurations for the Request handler
type Request ¶
type Request struct {
*fiber.CachedPayload
*http.Request
}
Request wraps a standard http request
func NewHTTPRequest ¶
NewHTTPRequest initialize a new client request from incoming server request
func (*Request) OperationName ¶
type Response ¶
type Response struct {
*fiber.CachedPayload
// contains filtered or unexported fields
}
func (*Response) BackendName ¶
BackendName returns the backend used to make the request
func (*Response) IsSuccess ¶
IsSuccess returns the success state of the request, which is true if the status
func (*Response) Label ¶ added in v0.2.0
Label returns all the values associated with the given key, in the response header. If the key does not exist, an empty slice will be returned.
func (*Response) StatusCode ¶
StatusCode returns the response status code
func (*Response) WithBackendName ¶
WithBackendName sets the given backend name in the response header. The modified response is returned.