func RequestHost(ctx context.Context) (string, error) {
	url, ok := ctx.Value(requestHost).(string)
	if ok {
		return url, nil
	}
	return url, errors.New("RequestHost is not set properly to context")
}
RequestHost gets the request host from the context
package httplog
import (
	"context"
	"github.com/pkg/errors"
	"github.com/rs/xid"
)
type contextKey string
func (c contextKey) String() string {
	return "context key " + string(c)
}
var (
	requestID       = contextKey("RequestID")
	requestHost     = contextKey("RequestHost")
	requestPort     = contextKey("RequestPort")
	requestPath     = contextKey("RequestPath")
	requestRawQuery = contextKey("RequestRawQuery")
	requestFragment = contextKey("RequestFragment")
)
func setRequest2Context(ctx context.Context, aud *tracker) context.Context {
	ctx = setRequestHost(ctx, aud)
	ctx = setRequestPort(ctx, aud)
	ctx = setRequestPath(ctx, aud)
	ctx = setRequestRawQuery(ctx, aud)
	ctx = setRequestFragment(ctx, aud)
	return ctx
}
func setRequestID(ctx context.Context) context.Context {
	guid := xid.New()
	rID := guid.String()
	ctx = context.WithValue(ctx, requestID, rID)
	return ctx
}
func RequestID(ctx context.Context) (string, error) {
	requestIDstr, ok := ctx.Value(requestID).(string)
	if ok {
		return requestIDstr, nil
	}
	return requestIDstr, errors.New("RequestID is not set properly to context")
}
func setRequestHost(ctx context.Context, audit *tracker) context.Context {
	host := audit.request.host
	ctx = context.WithValue(ctx, requestHost, host)
	return ctx
}