code: func resolveOptions(request *http.Request, pathStr string) (options userOptions, err error) {
  	options.format = resolveFormat(request)
  
  	// The expected format is "/project/path..."
  	parts := strings.SplitN(strings.TrimLeft(pathStr, "/"), "/", 2)
  	if len(parts) != 2 {
  		err = errors.Reason("invalid path %q", pathStr).Err()
  		return
  	}
  	options.path = types.StreamPath(parts[1])
  	prefix, name := options.path.Split()
  	if err = prefix.Validate(); err != nil {
  		return
  	}
  	if strings.Contains(name.String(), "*") {
  		options.wildcard = true
  	} else if err = name.Validate(); err != nil {
  		// Validate name, if it is a fully resolved path.
  		return
  	}
  	options.project = types.ProjectName(parts[0])
  	err = options.project.Validate()
  	return
  }
docs: // resolveOptions takes the request path and http request, and returns the
  // full set of requested options.
  // pathStr is a path to one or more streams in a prefix.  Format includes:
  // * Fully resolved path.  a/+/b/c
  // * Single star path.  a/+/b/*
  // * Double star path. a/+/**