2016-02-11 06:50:07 +08:00
|
|
|
package serializers
|
|
|
|
|
|
2024-12-05 22:32:10 +08:00
|
|
|
import "github.com/influxdata/telegraf"
|
2016-02-11 06:50:07 +08:00
|
|
|
|
2023-04-12 03:52:42 +08:00
|
|
|
// Creator is the function to create a new serializer
|
2024-12-05 22:32:10 +08:00
|
|
|
type Creator func() telegraf.Serializer
|
2023-04-12 03:52:42 +08:00
|
|
|
|
|
|
|
|
// Serializers contains the registry of all known serializers (following the new style)
|
2024-10-18 22:10:58 +08:00
|
|
|
var Serializers = make(map[string]Creator)
|
2023-04-12 03:52:42 +08:00
|
|
|
|
|
|
|
|
// Add adds a serializer to the registry. Usually this function is called in the plugin's init function
|
|
|
|
|
func Add(name string, creator Creator) {
|
|
|
|
|
Serializers[name] = creator
|
|
|
|
|
}
|