// Server starts gateway server created from the given configuration. // // It returns a function that can be used to explicitely stop // the kite server. func (d *Driver) Server(cfg *keygen.Config) (cancel func()) { kiteCfg := d.Kite(cfg, "keygen") keygen.NewServer(kiteCfg) go kiteCfg.Kite.Run() <-kiteCfg.Kite.ServerReadyNotify() cfg.ServerURL = fmt.Sprintf("http://127.0.0.1:%d/kite", kiteCfg.Kite.Port()) return kiteCfg.Kite.Close }