func mkDaemonFromEngine(eng *engine.Engine, t Fataler) *daemon.Daemon { iDaemon := eng.HackGetGlobalVar("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 }
func getDaemon(eng *engine.Engine) *daemon.Daemon { return eng.HackGetGlobalVar("httpapi.daemon").(*daemon.Daemon) }