mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-07-19 03:11:41 +02:00
Use receiver names from config (#34)
* Use common configuration format of 'receiver_name' -> 'receiver_config' * Adjust receiver configuration files
This commit is contained in:
@@ -2,9 +2,15 @@ package receivers
|
||||
|
||||
import (
|
||||
// "time"
|
||||
"encoding/json"
|
||||
|
||||
lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric"
|
||||
)
|
||||
|
||||
type defaultReceiverConfig struct {
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
type ReceiverConfig struct {
|
||||
Addr string `json:"address"`
|
||||
Port string `json:"port"`
|
||||
@@ -14,16 +20,13 @@ type ReceiverConfig struct {
|
||||
}
|
||||
|
||||
type receiver struct {
|
||||
name string
|
||||
addr string
|
||||
port string
|
||||
database string
|
||||
organization string
|
||||
sink chan lp.CCMetric
|
||||
typename string
|
||||
name string
|
||||
sink chan lp.CCMetric
|
||||
}
|
||||
|
||||
type Receiver interface {
|
||||
Init(config ReceiverConfig) error
|
||||
Init(name string, config json.RawMessage) error
|
||||
Start()
|
||||
Close()
|
||||
Name() string
|
||||
|
Reference in New Issue
Block a user