code: func matchStreams(streams []*coordinator.LogStream, pattern string) []*coordinator.LogStream {
  	// Filter results that match the requested stream name.
  	// ** turns into .*
  	// * turns into [^/]*
  	doubles := strings.Split(pattern, "**")
  	for i, d := range doubles {
  		singles := strings.Split(d, "*")
  		for j, s := range singles {
  			singles[j] = regexp.QuoteMeta(s)
  		}
  		doubles[i] = strings.Join(singles, "[^/]*")
  	}
  	r := regexp.MustCompile(fmt.Sprintf("^%s$", strings.Join(doubles, ".*")))
  	result := make([]*coordinator.LogStream, 0, len(streams))
  	for _, stream := range streams {
  		if stream.Purged {
  			continue
  		}
  		if stream.StreamType != logpb.StreamType_TEXT {
  			// Multistream viewing only supported for text streams.
  			continue
  		}
  		if r.MatchString(stream.Name) {
  			result = append(result, stream)
  		}
  	}
  	return result
  }
docs: // matchStreams returns streams that:
  // * Are not purged.
  // * Matches the path pattern.