Documentation ¶
Index ¶
- func ParseFromContext(ctx context.Context) (http.Header, error)
- type ClientHeader
- func (ch *ClientHeader) FromContext(ctx context.Context) (*ClientHeader, error)
- func (ch *ClientHeader) Get(key string) (string, error)
- func (ch *ClientHeader) Replace(header http.Header)
- func (ch *ClientHeader) Set(key, val string)
- func (ch *ClientHeader) ToContext(ctx context.Context) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientHeader ¶
type ClientHeader struct {
// contains filtered or unexported fields
}
ClientHeader used by client to convert custom headers to context.Context and send it to server. Server can use this object to parse the header from incoming context request
func New ¶
func New() *ClientHeader
func (*ClientHeader) FromContext ¶
func (ch *ClientHeader) FromContext(ctx context.Context) (*ClientHeader, error)
FromContext use to fetch header's object from context
func (*ClientHeader) Get ¶
func (ch *ClientHeader) Get(key string) (string, error)
Get used to fetch value from header
func (*ClientHeader) Replace ¶
func (ch *ClientHeader) Replace(header http.Header)
Replace use to change internal header's object
func (*ClientHeader) Set ¶
func (ch *ClientHeader) Set(key, val string)
Set new header's key and it's value
Click to show internal directories.
Click to hide internal directories.