Beispiel #1
0
func init() {
	registry.Register("github.com/trusch/horst/processors/blackhole", func(id string, config interface{}, mgr horst.ProcessorManager) (horst.Processor, error) {
		hole := &blackholeType{}
		hole.InitBase(id, config, mgr)
		return hole, nil
	})
}
Beispiel #2
0
func init() {
	registry.Register("github.com/trusch/horst/processors/projector", func(id string, config interface{}, mgr horst.ProcessorManager) (horst.Processor, error) {
		projector := &projectorType{data: make(chan projectorMessage, 32)}
		projector.InitBase(id, config, mgr)
		go projector.backend()
		return projector, nil
	})
}
Beispiel #3
0
func init() {
	registry.Register("github.com/trusch/horst/processors/naturals", func(id string, config interface{}, mgr horst.ProcessorManager) (horst.Processor, error) {
		naturals := &naturalsType{run: true}
		naturals.InitBase(id, config, mgr)
		go naturals.backend()
		return naturals, nil
	})
}
Beispiel #4
0
func init() {
	registry.Register("github.com/trusch/horst/processors/textsplitter", func(id string, config interface{}, mgr horst.ProcessorManager) (horst.Processor, error) {
		textsplitter := &textsplitterType{data: make(chan textsplitterMessage, 32)}
		textsplitter.InitBase(id, config, mgr)
		go textsplitter.backend()
		return textsplitter, nil
	})
}
Beispiel #5
0
func init() {
	registry.Register("github.com/trusch/horst/processors/twittersource", func(id string, config interface{}, mgr horst.ProcessorManager) (horst.Processor, error) {
		twittersource := &twittersourceType{}
		twittersource.InitBase(id, config, mgr)
		err := twittersource.getKeysFromConfig()
		if err != nil {
			return nil, err
		}
		go twittersource.backend()
		return twittersource, nil
	})
}
Beispiel #6
0
func init() {
	registry.Register("github.com/trusch/horst/processors/duplicator", func(id string, config interface{}, mgr horst.ProcessorManager) (horst.Processor, error) {
		duplicator := &duplicatorType{data: make(chan duplicatorMessage, 32)}
		duplicator.InitBase(id, config, mgr)
		numOfOutputs, ok := config.(float64)
		if !ok {
			return nil, fmt.Errorf("duplicator(%v)> config is not a number, it is %T", duplicator.ID, config)
		}
		duplicator.outputs = int(numOfOutputs)
		go duplicator.backend()
		return duplicator, nil
	})
}
Beispiel #7
0
func init() {
	registry.Register("github.com/trusch/horst/processors/roundrobin", func(id string, config interface{}, mgr horst.ProcessorManager) (horst.Processor, error) {
		roundrobin := &roundrobinType{data: make(chan roundrobinMessage, 32)}
		roundrobin.InitBase(id, config, mgr)
		numOfOutputs, ok := config.(float64)
		if !ok {
			return nil, fmt.Errorf("roundrobin(%v)> config is not a number, it is %T", roundrobin.ID, config)
		}
		roundrobin.outputs = int(numOfOutputs)
		go roundrobin.backend()
		return roundrobin, nil
	})
}
Beispiel #8
0
func init() {
	registry.Register("github.com/trusch/horst/processors/incrementalhistogram", func(id string, config interface{}, mgr horst.ProcessorManager) (horst.Processor, error) {
		incrementalhistogram := &incrementalhistogramType{
			data:      make(chan incrementalhistogramMessage, 32),
			histogram: make(map[string]float64),
		}
		incrementalhistogram.InitBase(id, config, mgr)
		err := incrementalhistogram.parseConfig()
		if err != nil {
			return nil, err
		}
		go incrementalhistogram.backend()
		return incrementalhistogram, nil
	})
}