Exemple #1
0
func startTestServer(config string) error {
	var err error
	server, err = srv.NewServer(config)
	if err != nil {
		return err
	}
	go func() {
		err := server.Start()
		if err != nil {
			return
		}
	}()
	return nil
}
Exemple #2
0
//GohanServer starts gohan server from configFile
func GohanServer(configFile string, test bool) (interface{}, error) {
	s, err := server.NewServer(configFile)
	if err != nil {
		return nil, err
	}
	if test {
		ts := httptest.NewServer(s.Router())
		return map[string]interface{}{
			"server": ts,
			"queue":  s.Queue(),
		}, nil
	}
	s.Start()
	return nil, nil
}