analyzer

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &cobra.Command{
	Use:          "analyzer",
	Short:        "Skydive analyzer",
	Long:         "Skydive analyzer",
	SilenceUsage: true,
	Run: func(cmd *cobra.Command, args []string) {
		logging.GetLogger().Notice("Skydive Analyzer starting...")

		router := mux.NewRouter().StrictSlash(true)

		server, err := analyzer.NewServerFromConfig(router)
		if err != nil {
			logging.GetLogger().Fatalf("Can't start Analyzer : %v", err)
		}

		storage, err := elasticseach.New()
		if err != nil {
			logging.GetLogger().Fatalf("Can't connect to ElasticSearch server : %v", err)
		}
		server.SetStorage(storage)

		logging.GetLogger().Notice("Skydive Analyzer started !")
		go server.ListenAndServe()

		ch := make(chan os.Signal)
		signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
		<-ch

		server.Stop()
		storage.Close()

		logging.GetLogger().Notice("Skydive Analyzer stopped.")
	},
}

Functions

This section is empty.

Types

This section is empty.

Source Files

  • analyzer.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL