mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-08-08 07:56:57 +08:00
Initial commit
This commit is contained in:
30
exporter/model.go
Normal file
30
exporter/model.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package exporter
|
||||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/zr-hebo/sniffer-agent/model"
|
||||
)
|
||||
|
||||
var (
|
||||
exportType string
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&exportType,"export_type", "cli", "export type. Default is cli, that is command line")
|
||||
}
|
||||
|
||||
type Exporter interface {
|
||||
Export(model.QueryPiece) error
|
||||
}
|
||||
|
||||
func NewExporter() Exporter {
|
||||
switch exportType {
|
||||
case "cli":
|
||||
return NewCliExporter()
|
||||
case "kafka":
|
||||
return NewKafkaExporter()
|
||||
default:
|
||||
return NewCliExporter()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user