HeaderMediaType returns the MIME mediaType for a particular ScrapeProtocol.
()
| 560 | |
| 561 | // HeaderMediaType returns the MIME mediaType for a particular ScrapeProtocol. |
| 562 | func (s ScrapeProtocol) HeaderMediaType() string { |
| 563 | if _, ok := ScrapeProtocolsHeaders[s]; !ok { |
| 564 | return "" |
| 565 | } |
| 566 | mediaType, _, err := mime.ParseMediaType(ScrapeProtocolsHeaders[s]) |
| 567 | if err != nil { |
| 568 | return "" |
| 569 | } |
| 570 | return mediaType |
| 571 | } |
| 572 | |
| 573 | var ( |
| 574 | PrometheusProto ScrapeProtocol = "PrometheusProto" |
no outgoing calls