# momo **Repository Path**: linqwen/momo ## Basic Information - **Project Name**: momo - **Description**: go语言写的实用工具类库 - **Primary Language**: Go - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-31 - **Last Updated**: 2025-09-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # momo #### 介绍 go语言写的实用类库 #### 使用说明 func main() { // 定义命令行参数 mode := flag.String("mode", "release", "运行模式:debug, release, test") acl := flag.Bool("acl", true, "是否启用访问控制:true,false") acs := flag.Bool("acs", true, "是否启用访问统计:true,false") port := flag.Int("port", 6001, "主程序运行端口") prome := flag.Int("prome_port", 6011, "prometheus运行端口") static := flag.String("static", "admin", "静态目录") flag.Parse() // 初始化基本路由 r := momo.NewRouterBuilder().WithMode(*mode).WithAcl(*acl).WithAcs(*acs).WithPromePort(*prome).WithLog(true).Build() r.Static("/view", "view") r.Static("/admin", *static) fmt.Printf(" - using static: %v\n", *static) fmt.Printf(" - using port: %v\n", *port) // 注册自定义路由分组 // genAdapter := igin.NewGinRouterAdapter(r.Engine).Group("/api/gen") // genCtl.DataSourceRouter(genAdapter) r.Run(fmt.Sprintf("0.0.0.0:%d", *port)) // 自定义rbac数据库 // db := dao.RbacDb // db := rbacService.RbacDb // userRepo := rbac.NewGormUserRepo(db, &model.UserEntity{}) // roleRepo := rbac.NewGormRoleRepo(db, &model.RoleEntity{}) // permitRepo := rbac.NewGormPermitRepo(db, &model.MenuEntity{}) // rb.config.Service = rbac.NewRBACService(userRepo, roleRepo, permitRepo, rb.config.SecretKey) }