Пример #1
0
func main() {
	flag.StringVar(&configFilePath, "config", configFilePath, "configuration file")
	flag.Parse()

	settings, err := config.ReadConfigFile(configFilePath)
	if err != nil {
		log.Fatal("FATAL while reading config files: ", err)
	}
	if len(settings.Docker) == 0 {
		log.Fatal("FATAL: empty docker configuration list:\n", settings)
	}

	client, err := dckr.NewClientFirstOf(settings.Docker)
	if err != nil {
		log.Print(err)
		log.Fatal("Failed to make any docker client, exiting")
	}

	server := server.NewServer(settings.Server, client)
	log.Println("Starting GEF server at: ", settings.Server.Address)
	err = server.Start()
	if err != nil {
		log.Println("GEF server failed: ", err)
	}
}
Пример #2
0
func newClient(t *testing.T) dckr.Client {
	c, err := dckr.NewClientFirstOf(clientConf)
	if err != nil {
		t.Error(err)
		t.Error("--- client is not valid (this test requires a docker server)")
		t.Fail()
	}

	if !c.IsValid() {
		t.Error("client not valid (unable to ping)")
	}
	return c
}