mirror of
https://github.com/hanzoai/otel-collector.git
synced 2026-11-02 13:34:59 +00:00
21 lines
368 B
Go
21 lines
368 B
Go
package bodyparser
|
|
|
|
import "go.opentelemetry.io/collector/pdata/plog"
|
|
|
|
type Parser interface {
|
|
Parse(body []byte) (plog.Logs, int, error)
|
|
}
|
|
|
|
func GetBodyParser(source string) Parser {
|
|
switch source {
|
|
// case "google":
|
|
// return &GCloud{}
|
|
case "json":
|
|
return NewJsonBodyParser()
|
|
case "heroku":
|
|
return NewHerokuBodyParser()
|
|
default:
|
|
return &Default{}
|
|
}
|
|
}
|