Documentation ¶
Overview ¶
Package headers contains middlewares for manipulating headers on request.
Index ¶
- func Add(header, value string) c.Middleware
- func Del(header string) c.Middleware
- func FromContext(key interface{}) c.Middleware
- func Method(method string) c.Middleware
- func Set(header, value string) c.Middleware
- func SetMap(headers map[string]string) c.Middleware
- func ToContext(ctx context.Context, key interface{}, header string, values ...string) context.Context
- func ToContextList(ctx context.Context, key interface{}, h []Header) context.Context
- type Header
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
func FromContext(key interface{}) c.Middleware
FromContext adds header to request that is defined in context with provided key.
func Method ¶
func Method(method string) c.Middleware
Method sets request method to ongoing request.
func SetMap ¶
func SetMap(headers map[string]string) c.Middleware
SetMap sets multiple headers provided in a map.
func ToContext ¶
func ToContext(ctx context.Context, key interface{}, header string, values ...string) context.Context
ToContext adds headers to context that can be used with FromContext middleware. This is intended to be used for single header (but possibly multiple values). If you need to set multiple headers, use ToContextList.
Types ¶
Click to show internal directories.
Click to hide internal directories.