chore: remove dburl usage

dburl adds aliases for everything, which breaks if two schemes are similar enough (anything with `aws_` as a prefix broke scheme registration). It does not appear to add anything, so we'll drop that dependency.

Also remove go-jsonmerge, as this was refactored to use structs instead of byte manipulation...
This commit is contained in:
Jose Diaz-Gonzalez
2021-01-04 00:42:13 -05:00
parent fd85b1f605
commit f5fa94cc9c
3 changed files with 1 additions and 71 deletions

View File

@@ -11,7 +11,6 @@ import (
"github.com/dokku/dokku/plugins/common"
"github.com/joncalhoun/qson"
"github.com/xo/dburl"
)
type vectorConfig struct {
@@ -28,61 +27,6 @@ type vectorSink map[string]interface{}
const vectorContainerName = "vector"
func init() {
sinks := []string{
"aws_cloudwatch_logs",
"aws_kinesis_firehose",
"aws_kinesis_streams",
"aws_s3", "aws_sqs",
"azure_monitor_logs",
"blackhole",
"clickhouse",
"console",
"datadog_logs",
"elasticsearch",
"file",
"gcp_cloud_storage",
"gcp_pubsub",
"gcp_stackdriver_logs",
"honeycomb",
"http",
"humio_logs",
"influxdb_logs",
"kafka",
"logdna",
"loki",
"nats",
"new_relic_logs",
"papertrail",
"pulsar",
"sematext_logs",
"socket",
"splunk_hec",
"vector",
}
for _, sink := range sinks {
dburl.Register(dburl.Scheme{
Driver: sink,
Generator: genOpaqueWithMissingPath,
Proto: 0,
Opaque: false,
Aliases: []string{},
Override: "",
})
}
}
func genOpaqueWithMissingPath(u *dburl.URL) (string, error) {
return u.Opaque + genQueryOptions(u.Query()), nil
}
func genQueryOptions(q url.Values) string {
if s := q.Encode(); s != "" {
return "?" + s
}
return ""
}
func killVectorContainer() error {
if !common.ContainerExists(vectorContainerName) {
return nil
@@ -165,7 +109,7 @@ func stopVectorContainer() error {
func valueToConfig(appName string, value string) (vectorSink, error) {
var data vectorSink
u, err := dburl.Parse(value)
u, err := url.Parse(value)
if err != nil {
return data, err
}