code: func UpstreamResolverFuncFromClient(client *api.Client) func(cfg UpstreamConfig) (connect.Resolver, error) {
  	return func(cfg UpstreamConfig) (connect.Resolver, error) {
  		// For now default to service as it has the most natural meaning and the error
  		// that the service doesn't exist is probably reasonable if misconfigured. We
  		// should probably handle actual configs that have invalid types at a higher
  		// level anyway (like when parsing).
  		typ := connect.ConsulResolverTypeService
  		if cfg.DestinationType == "prepared_query" {
  			typ = connect.ConsulResolverTypePreparedQuery
  		}
  		return &connect.ConsulResolver{
  			Client:     client,
  			Namespace:  cfg.DestinationNamespace,
  			Name:       cfg.DestinationName,
  			Type:       typ,
  			Datacenter: cfg.Datacenter,
  		}, nil
  	}
  }
docs: // UpstreamResolverFuncFromClient returns a closure that captures a consul
  // client and when called provides a ConsulResolver that can resolve the given
  // UpstreamConfig using the provided api.Client dependency.