func TracingHeaderMatcher() runtime.HeaderMatcherFunc {
	return ExtendedDefaultHeaderMatcher(GetXB3Headers()...)
}
TracingHeaderMatcher tracing headers
package gateway
import (
	"context"
	"fmt"
	"net/http"
	"net/textproto"
	"strings"
	"google.golang.org/grpc/metadata"
	"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
)
const XForwardedFor = "X-Forwarded-For"
func GetGeoHeaders() []string {
	return []string{
		"x-geo-org",
		"x-geo-country-code",
		"x-geo-country-name",
		"x-geo-region-code",
		"x-geo-region-name",
		"x-geo-city-name",
		"x-geo-postal-code",
		"x-geo-latitude",
		"x-geo-longitude",
	}
}
func GetXB3Headers() []string {
	return []string{
		"x-b3-traceid",
		"x-b3-parentspanid",
		"x-b3-spanid",
		"x-b3-sampled",
	}
}
func Header(ctx context.Context, key string) (string, bool) {
	if l, ok := HeaderN(ctx, key, 1); ok {
		return l[0], ok
	}
	return "", false
}
func HeaderN(ctx context.Context, key string, n int) (val []string, found bool) {
	if n == 0 {
		return
	}
	if smd, ok := runtime.ServerMetadataFromContext(ctx); ok {
		ctx = metadata.NewIncomingContext(ctx, smd.HeaderMD)
	}
	imd, iok := metadata.FromIncomingContext(ctx)
	omd, ook := metadata.FromOutgoingContext(ctx)
	md := metadata.Join(imd, omd)
	if !iok && !ook {
		return nil, false
	}
	key = strings.ToLower(key)
	if v, ok := md[key]; ok {
		val = append(val, v...)
		found = true
	}
	key = runtime.MetadataPrefix + key
	if v, ok := md[key]; ok {
		val = append(val, v...)
		found = true
	}
	switch {
	case !found:
		return
	case n < 0 || len(val) == n:
		return
	case len(val) < n:
		return nil, false
	default:
		return val[:n], found
	}
}
func PrefixOutgoingHeaderMatcher(key string) (string, bool) {
	return "", false
}
func handleForwardResponseServerMetadata(matcher runtime.HeaderMatcherFunc, w http.ResponseWriter, md runtime.ServerMetadata) {
	for k, vs := range md.HeaderMD {
		if h, ok := matcher(k); ok {
			for _, v := range vs {
				w.Header().Add(h, v)
			}
		}
	}
}
func handleForwardResponseTrailerHeader(w http.ResponseWriter, md runtime.ServerMetadata) {
	for k := range md.TrailerMD {
		if strings.HasPrefix(k, "error-") || strings.HasPrefix(k, "success-") {
			continue
		}
		tKey := textproto.CanonicalMIMEHeaderKey(fmt.Sprintf("%s%s", runtime.MetadataTrailerPrefix, k))
		w.Header().Add("Trailer", tKey)
	}
}
func handleForwardResponseTrailer(w http.ResponseWriter, md runtime.ServerMetadata) {
	for k, vs := range md.TrailerMD {
		tKey := fmt.Sprintf("%s%s", runtime.MetadataTrailerPrefix, k)
		for _, v := range vs {
			w.Header().Add(tKey, v)
		}
	}
}
func GeoIPHeaderMatcher() runtime.HeaderMatcherFunc {
	return ExtendedDefaultHeaderMatcher(GetGeoHeaders()...)
}
func RequestIDHeaderMatcher() runtime.HeaderMatcherFunc {
	return ExtendedDefaultHeaderMatcher("request-id")
}