mirror of
https://github.com/Icinga/icingabeat.git
synced 2025-04-08 17:15:05 +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 (
|
||||
"os"
|
||||
|
||||
"github.com/elastic/beats/libbeat/beat"
|
||||
|
||||
"github.com/icinga/icingabeat/beater"
|
||||
"github.com/icinga/icingabeat/cmd"
|
||||
)
|
||||
|
||||
func main() {
|
||||
err := beat.Run("icingabeat", "", beater.New)
|
||||
if err != nil {
|
||||
if err := cmd.RootCmd.Execute(); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user