code: func RequestIDHandler(name, headerName string) func(next xhandler.HandlerC) xhandler.HandlerC {
  	return func(next xhandler.HandlerC) xhandler.HandlerC {
  		return xhandler.HandlerFuncC(func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
  			id, ok := IDFromContext(ctx)
  			if !ok {
  				id = xid.New()
  				ctx = context.WithValue(ctx, idKey, id)
  			}
  			if name != "" {
  				FromContext(ctx).SetField(name, id)
  			}
  			if headerName != "" {
  				w.Header().Set(headerName, id.String())
  			}
  			next.ServeHTTPC(ctx, w, r)
  		})
  	}
  }
docs: // RequestIDHandler returns a handler setting a unique id to the request which can
  // be gathered using IDFromContext(ctx). This generated id is added as a field to the
  // logger using the passed name as field name. The id is also added as a response
  // header if the headerName is not empty.
  //
  // The generated id is a URL safe base64 encoded mongo object-id-like unique id.
  // Mongo unique id generation algorithm has been selected as a trade-off between
  // size and ease of use: UUID is less space efficient and snowflake requires machine
  // configuration.