Example #1
0
func mkDaemonFromEngine(eng *engine.Engine, t log.Fataler) *daemon.Daemon {
	iDaemon := eng.Hack_GetGlobalVar("httpapi.daemon")
	if iDaemon == nil {
		panic("Legacy daemon field not set in engine")
	}
	daemon, ok := iDaemon.(*daemon.Daemon)
	if !ok {
		panic("Legacy daemon field in engine does not cast to *daemon.Daemon")
	}
	return daemon
}
Example #2
0
func mkServerFromEngine(eng *engine.Engine, t utils.Fataler) *server.Server {
	iSrv := eng.Hack_GetGlobalVar("httpapi.server")
	if iSrv == nil {
		panic("Legacy server field not set in engine")
	}
	srv, ok := iSrv.(*server.Server)
	if !ok {
		panic("Legacy server field in engine does not cast to *server.Server")
	}
	return srv
}