cc-metric-collector/sinks/metricSink.go
Holger Obermaier 5cbd345a1d Avoid go vet warning:
struct field tag `json:"..., omitempty"` not compatible with reflect.StructTag.Get: suspicious space in struct tag value
struct field tag `json:"...", omitempty` not compatible with reflect.StructTag.Get: key:"value" pairs not separated by spaces
2022-01-20 13:06:38 +01:00

43 lines
936 B
Go

package sinks
import (
// "time"
lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric"
)
type sinkConfig struct {
Type string `json:"type"`
Host string `json:"host,omitempty"`
Port string `json:"port,omitempty"`
Database string `json:"database,omitempty"`
User string `json:"user,omitempty"`
Password string `json:"password,omitempty"`
Organization string `json:"organization,omitempty"`
SSL bool `json:"ssl,omitempty"`
MetaAsTags bool `json:"meta_as_tags,omitempty"`
}
type sink struct {
host string
port string
user string
password string
database string
organization string
ssl bool
meta_as_tags bool
name string
}
type Sink interface {
Init(config sinkConfig) error
Write(point lp.CCMetric) error
Flush() error
Close()
Name() string
}
func (s *sink) Name() string {
return s.name
}