xcontext

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestHeaderKey contextKey = 1 + iota
)

Variables

This section is empty.

Functions

func CreateHttpContext

func CreateHttpContext(header http.Header) context.Context

func SetRequestHeadersFromContext

func SetRequestHeadersFromContext(httpContext HttpContext, header http.Header) error

SetRequestHeadersFromContext iterates over headers in context and add adds all values to the request headers map

Types

type HttpContext

type HttpContext interface {
	GetHTTPRequestHeaders() (http.Header, bool)
}

HttpContext is a context bucket for http related objects like headers

func NewHttpContextWrapper

func NewHttpContextWrapper(ctx context.Context) HttpContext

NewHttpContextWrapper creates a wrapper for a context object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL