GohanServer starts gohan server from configFile
(configFile string, test bool)
| 190 | |
| 191 | //GohanServer starts gohan server from configFile |
| 192 | func GohanServer(configFile string, test bool) (interface{}, error) { |
| 193 | s, err := server.NewServer(configFile) |
| 194 | if err != nil { |
| 195 | return nil, err |
| 196 | } |
| 197 | if test { |
| 198 | ts := httptest.NewServer(s.Router()) |
| 199 | return map[string]interface{}{ |
| 200 | "server": ts, |
| 201 | "queue": s.Queue(), |
| 202 | }, nil |
| 203 | } |
| 204 | s.Start() |
| 205 | return nil, nil |
| 206 | } |