mirror of
				https://github.com/ClusterCockpit/cc-metric-collector.git
				synced 2025-10-31 00:55:06 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			489 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			489 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package sinks
 | |
| 
 | |
| import (
 | |
| 	"encoding/json"
 | |
| 
 | |
| 	lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric"
 | |
| )
 | |
| 
 | |
| type defaultSinkConfig struct {
 | |
| 	MetaAsTags bool   `json:"meta_as_tags,omitempty"`
 | |
| 	Type       string `json:"type"`
 | |
| }
 | |
| 
 | |
| type sink struct {
 | |
| 	meta_as_tags bool
 | |
| 	name         string
 | |
| }
 | |
| 
 | |
| type Sink interface {
 | |
| 	Init(name string, config json.RawMessage) error
 | |
| 	Write(point lp.CCMetric) error
 | |
| 	Flush() error
 | |
| 	Close()
 | |
| 	Name() string
 | |
| }
 | |
| 
 | |
| func (s *sink) Name() string {
 | |
| 	return s.name
 | |
| }
 |