func NewParser() *DefaultParser {
	return &DefaultParser{
		formatParsers: map[string]formatParser{
			"application/x-protobuf":       protobuf.ParseRequest,
			"application/json":             json.ParseRequest,
			"text/plain":                   text.ParseRequest,
			"application/openmetrics-text": text.ParseRequest,
		},
	}
}
NewParser returns a parser with the correct mapping of format and format parser.
package parser
import (
	"fmt"
	"mime"
	"net/http"
	"github.com/timescale/promscale/pkg/api/parser/json"
	"github.com/timescale/promscale/pkg/api/parser/protobuf"
	"github.com/timescale/promscale/pkg/api/parser/text"
	"github.com/timescale/promscale/pkg/prompb"
)
type formatParser func(*http.Request, *prompb.WriteRequest) error
type Preprocessor interface {
	Process(*http.Request, *prompb.WriteRequest) error
}
type DefaultParser struct {
	preprocessors []Preprocessor
	formatParsers map[string]formatParser
}