code: func ParseURL(v string) (*StreamAddr, error) {
  	u, err := url.Parse(v)
  	if err != nil {
  		return nil, errors.Annotate(err, "failed to parse URL").Err()
  	}
  
  	// Validate Scheme.
  	if u.Scheme != logDogURLScheme {
  		return nil, errors.Reason("URL scheme %q is not %s", u.Scheme, logDogURLScheme).Err()
  	}
  	addr := StreamAddr{
  		Host: u.Host,
  	}
  
  	parts := strings.SplitN(u.Path, "/", 3)
  	if len(parts) != 3 || len(parts[0]) != 0 {
  		return nil, errors.Reason("URL path does not include both project and path components: %s", u.Path).Err()
  	}
  
  	addr.Project, addr.Path = ProjectName(parts[1]), StreamPath(parts[2])
  	if err := addr.Project.Validate(); err != nil {
  		return nil, errors.Annotate(err, "invalid project name: %q", addr.Project).Err()
  	}
  
  	if err := addr.Path.Validate(); err != nil {
  		return nil, errors.Annotate(err, "invalid stream path: %q", addr.Path).Err()
  	}
  
  	return &addr, nil
  }
docs: // ParseURL parses a LogDog URL into a Stream. If the URL is malformed, or
  // if the host, project, or path is invalid, an error will be returned.
  //
  // A LogDog URL has the form:
  // logdog://<host>/<project>/<prefix>/+/<name>