func (panel *Panel) Run() {
	go func() {
		panic(panel.Engine.Run(":" + conv.String(panel.Port)))
	}()
}
Run delayed application
package summer
import (
	"text/template"
	"time"
	"github.com/night-codes/summer/ttpl"
	"github.com/gin-gonic/gin"
	"github.com/night-codes/conv"
	ai "github.com/night-codes/mgo-ai"
	mongo "github.com/night-codes/mgo-wrapper"
)
type (
	Settings struct {
		Port              uint
		Title             string
		DefaultPage       string
		AuthSalt          string
		AuthPrefix        string                  
		AuthSkipIP        bool                    
		Path              string                  
		Views             string                  
		ViewsDoT          string                  
		Files             string                  
		DBName            string                  
		UsersCollection   string                  
		NotifyCollection  string                  
		AICollection      string                  
		Debug             bool                    
		Vars              map[string]interface{}  
		TFuncMap          template.FuncMap        
		MakeEngineFn      func(*gin.Engine)       
		MakeRouterGroupFn func(*gin.RouterGroup)  
		FirstStart        func()                  
		DisableAuth       bool                    
		DisableFirstStart bool                    
		JS                []string                
		CSS               []string                
		RouterGroup       *gin.RouterGroup
		Engine            *gin.Engine
		HashDBFn          func(login, password, authSalt string) string
		HashCookieFn      func(login, password, authSalt, ip, userAgent string) string
		DelayStart        bool
	}
	Panel struct {
		Settings
		RootMenu *Menu
		MainMenu *Menu
		DropMenu *Menu
		Groups *GroupsList
		Modules *ModuleList
		Users *Users
		auth     *auth
		menuList *menuList
		AI       ai.AI
	}
)
func Create(s Settings) *Panel {
	var engine *gin.Engine
	if s.Debug {
		gin.SetMode(gin.DebugMode)
		engine = gin.Default()
	} else {
		gin.SetMode(gin.ReleaseMode)
		engine = gin.New()
	}
	panel := Panel{
		Settings: Settings{
			Port:              8080,
			AuthSalt:          "+Af761",
			AuthPrefix:        "adm-summer-",
			Title:             "Summer Panel",
			Path:              "",
			Views:             "templates/main",
			ViewsDoT:          "templates/doT.js",
			Files:             "files",
			DBName:            "summerPanel",
			DefaultPage:       "/settings",
			UsersCollection:   "admins",
			AICollection:      "ai",
			Vars:              map[string]interface{}{},
			FirstStart:        func() {},
			MakeEngineFn:      func(*gin.Engine) {},
			MakeRouterGroupFn: func(*gin.RouterGroup) {},
			HashDBFn:          func(login, password, authSalt string) string { return H3hash(password + authSalt) },
			HashCookieFn:      func(login, dbpass, authSalt, ip, userAgent string) string { return H3hash(ip + dbpass + authSalt) },
			Engine:            engine,
		},
		menuList: createMenuList(),
		Modules:  createModuleList(),
		RootMenu: &Menu{Title: "[Root]"},
		MainMenu: &Menu{Title: "[Main]"},
		DropMenu: &Menu{Title: "[Drop]"},
		Groups:   new(GroupsList),
		Users:    new(Users),
		auth:     new(auth),
	}
	extend(&panel.Settings, &s)
	panel.MakeEngineFn(panel.Engine)
	panel.init()
	return &panel
}
func (panel *Panel) AddModule(settings *ModuleSettings, s Simple) Simple {
	return createModule(panel, settings, s)
}
func (panel *Panel) AddPage(name string, title string, menu *Menu, originTemplate ...bool) Simple {
	settings := &ModuleSettings{
		Name:  name,
		Title: title,
		Menu:  menu,
	}
	if len(originTemplate) > 0 {
		settings.OriginTemplate = originTemplate[0]
	}
	return panel.AddModule(settings, &Module{})
}
func (panel *Panel) AddOpenPage(name string, title string, menu *Menu, originTemplate ...bool) Simple {
	settings := &ModuleSettings{
		Name:        name,
		Title:       title,
		Menu:        menu,
		DisableAuth: true,
	}
	if len(originTemplate) > 0 {
		settings.OriginTemplate = originTemplate[0]
	}
	return panel.AddModule(settings, &Module{})
}
func (panel *Panel) init() {
	panel.RootMenu.init(panel, nil)
	panel.MainMenu.init(panel, panel.RootMenu)
	panel.DropMenu.init(panel, panel.RootMenu)
	panel.Users.init(panel)
	panel.auth.init(panel)
	panel.correctPath()
	panel.setVariables()
	panel.initTpl()
	panel.AI = *ai.Create(mongo.DB(panel.DBName).C(panel.AICollection))
	panel.Engine.Use(gzipper)
	panel.Engine.Static(panel.Path+"/files", panel.Files)
	panel.Engine.Static(panel.Path+"/pkgFiles", PackagePath()+"/files")
	panel.RouterGroup = panel.Engine.Group(panel.Path)
	panel.MakeRouterGroupFn(panel.RouterGroup)
	panel.RouterGroup.GET("/", func(c *gin.Context) {
		c.Header("Expires", time.Now().String())
		c.Header("Cache-Control", "no-cache")
		c.Redirect(301, panel.Path+panel.DefaultPage)
	})
	if !panel.DelayStart {
		go func() {
			panic(panel.Engine.Run(":" + conv.String(panel.Port)))
		}()
	}
}
func (panel *Panel) initTpl() {
	if panel.TFuncMap == nil {
		panel.TFuncMap = template.FuncMap{}
	}
	panel.TFuncMap["jsoner"] = jsoner
	panel.TFuncMap["menu"] = getMenuItems
	panel.TFuncMap["user"] = func(login string) (user *UsersStruct) {
		user, _ = panel.Users.GetByLogin(login)
		return
	}
	panel.TFuncMap["tabs"] = getTabs
	panel.TFuncMap["site"] = getSite
	panel.TFuncMap["var"] = func(key string) interface{} {
		return panel.Vars[key]
	}
	panel.TFuncMap["o"] = func(key string) interface{} {
		return ""
	}
	ttpl.Use(panel.Engine, []string{PackagePath() + "/templates/main/", panel.Views + "/"}, panel.ViewsDoT, panel.TFuncMap)
}
func (panel *Panel) setVariables() {
	if panel.Vars == nil {
		panel.Vars = make(map[string]interface{})
	}
	panel.Vars["panel"] = &panel
	panel.Vars["path"] = panel.Path
	panel.Vars["title"] = panel.Title
	panel.Vars["mainMenu"] = panel.MainMenu
	panel.Vars["dropMenu"] = panel.DropMenu
}
func (panel *Panel) correctPath() {
	if len(panel.Path) > 0 {
		if panel.Path[len(panel.Path)-1] == '/' {
			panel.Path = panel.Path[:len(panel.Path)-1]
		}
		if len(panel.Path) > 0 && panel.Path[0] != '/' {
			panel.Path = "/" + panel.Path
		}
	}
	if len(panel.DefaultPage) == 0 || panel.DefaultPage[0] != '/' {
		panel.DefaultPage = "/" + panel.DefaultPage
	}
}