Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddOptions ¶
AddOptions defines the headers to be added to the response if they are not already present.
type Options ¶
type Options struct {
Add AddOptions
Set SetOptions
Remove RemoveOptions
}
Options defines the total configuration for the response transformer middleware.
type RemoveOptions ¶
type RemoveOptions struct {
Headers []string
}
RemoveOptions defines the headers to be removed from the response.
type ResponseTransFormaterMiddleware ¶
type ResponseTransFormaterMiddleware struct {
// contains filtered or unexported fields
}
ResponseTransFormaterMiddleware is a middleware that transforms the response by adding, setting, or removing headers.
func NewMiddleware ¶
func NewMiddleware(opts Options) *ResponseTransFormaterMiddleware
NewMiddleware creates a new ResponseTransFormaterMiddleware instance.
func (*ResponseTransFormaterMiddleware) ServeHTTP ¶
func (m *ResponseTransFormaterMiddleware) ServeHTTP(ctx context.Context, c *app.RequestContext)
type SetOptions ¶ added in v0.3.0
SetOptions defines the headers to be set on the response, overwriting any existing values.
Click to show internal directories.
Click to hide internal directories.