2021-03-26 16:48:09 +01:00
|
|
|
package sinks
|
|
|
|
|
|
|
|
import (
|
2021-10-04 15:23:43 +02:00
|
|
|
// "time"
|
|
|
|
lp "github.com/influxdata/line-protocol"
|
2021-03-26 16:48:09 +01:00
|
|
|
)
|
|
|
|
|
2021-05-18 15:16:10 +02:00
|
|
|
type SinkConfig struct {
|
|
|
|
Host string `json:"host"`
|
|
|
|
Port string `json:"port"`
|
|
|
|
Database string `json:"database"`
|
|
|
|
User string `json:"user"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
Organization string `json:"organization"`
|
|
|
|
Type string `json:"type"`
|
2021-06-30 16:56:47 +02:00
|
|
|
SSL bool `json:"ssl"`
|
2021-05-18 15:16:10 +02:00
|
|
|
}
|
|
|
|
|
2021-03-26 16:48:09 +01:00
|
|
|
type Sink struct {
|
2021-05-18 15:16:10 +02:00
|
|
|
host string
|
|
|
|
port string
|
|
|
|
user string
|
|
|
|
password string
|
|
|
|
database string
|
|
|
|
organization string
|
2021-06-30 16:56:47 +02:00
|
|
|
ssl bool
|
2021-03-26 16:48:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type SinkFuncs interface {
|
2021-05-18 15:16:10 +02:00
|
|
|
Init(config SinkConfig) error
|
2021-10-04 15:23:43 +02:00
|
|
|
Write(point lp.MutableMetric) error
|
2021-03-26 16:48:09 +01:00
|
|
|
Close()
|
|
|
|
}
|