mirror of
https://github.com/Icinga/icingabeat.git
synced 2025-07-27 15:54:01 +02:00
Move beater interface to cmd package
This commit is contained in:
parent
dd3104e1c6
commit
136ab9b250
12
cmd/root.go
Normal file
12
cmd/root.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
cmd "github.com/elastic/beats/libbeat/cmd"
|
||||||
|
"github.com/icinga/icingabeat/beater"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Name of this beat
|
||||||
|
var Name = "icingabeat"
|
||||||
|
|
||||||
|
// RootCmd to handle beats cli
|
||||||
|
var RootCmd = cmd.GenRootCmd(Name, "", beater.New)
|
7
main.go
7
main.go
@ -3,14 +3,11 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/elastic/beats/libbeat/beat"
|
"github.com/icinga/icingabeat/cmd"
|
||||||
|
|
||||||
"github.com/icinga/icingabeat/beater"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
err := beat.Run("icingabeat", "", beater.New)
|
if err := cmd.RootCmd.Execute(); err != nil {
|
||||||
if err != nil {
|
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user