code: func (ub *URLBuilder) BuildManifestURL(ref reference.Named) (string, error) {
  	route := ub.cloneRoute(RouteNameManifest)
  
  	tagOrDigest := ""
  	switch v := ref.(type) {
  	case reference.Tagged:
  		tagOrDigest = v.Tag()
  	case reference.Digested:
  		tagOrDigest = v.Digest().String()
  	default:
  		return "", fmt.Errorf("reference must have a tag or digest")
  	}
  
  	manifestURL, err := route.URL("name", ref.Name(), "reference", tagOrDigest)
  	if err != nil {
  		return "", err
  	}
  
  	return manifestURL.String(), nil
  }
docs: // BuildManifestURL constructs a url for the manifest identified by name and
  // reference. The argument reference may be either a tag or digest.