mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-11-10 04:27:25 +01:00
Format Receivers
This commit is contained in:
parent
7106e465ad
commit
f3697b9991
@ -14,7 +14,7 @@ type ReceiverConfig struct {
|
||||
}
|
||||
|
||||
type Receiver struct {
|
||||
name string
|
||||
name string
|
||||
addr string
|
||||
port string
|
||||
database string
|
||||
|
@ -1,12 +1,12 @@
|
||||
package receivers
|
||||
|
||||
import (
|
||||
"errors"
|
||||
s "github.com/ClusterCockpit/cc-metric-collector/sinks"
|
||||
protocol "github.com/influxdata/line-protocol"
|
||||
nats "github.com/nats-io/nats.go"
|
||||
"log"
|
||||
"time"
|
||||
"errors"
|
||||
)
|
||||
|
||||
type NatsReceiver struct {
|
||||
@ -19,7 +19,7 @@ var DefaultTime = func() time.Time {
|
||||
}
|
||||
|
||||
func (r *NatsReceiver) Init(config ReceiverConfig, sink s.SinkFuncs) error {
|
||||
if len(config.Addr) == 0 ||
|
||||
if len(config.Addr) == 0 ||
|
||||
len(config.Port) == 0 ||
|
||||
len(config.Database) == 0 {
|
||||
return errors.New("Not all configuration variables set required by NatsReceiver")
|
||||
|
Loading…
Reference in New Issue
Block a user