func NewURLBuilderFromString(root string, relative bool) (*URLBuilder, error) {
	u, err := url.Parse(root)
	if err != nil {
		return nil, err
	}
	return NewURLBuilder(u, relative), nil
}
NewURLBuilderFromString workes identically to NewURLBuilder except it takes
a string argument for the root, returning an error if it is not a valid
url.
package v2
import (
	"net"
	"net/http"
	"net/url"
	"strconv"
	"strings"
	"github.com/docker/distribution/reference"
	"github.com/gorilla/mux"
)
type URLBuilder struct {
	root     *url.URL  
	router   *mux.Router
	relative bool
}
func NewURLBuilder(root *url.URL, relative bool) *URLBuilder {
	return &URLBuilder{
		root:     root,
		router:   Router(),
		relative: relative,
	}
}