一个轻量、灵活、优雅且功能齐全的 RBAC 脚手架,基于 GIN + GORM 2.0 + Casbin 2.0 + Wire DI。基于 Golang + Gin + GORM 2.0 + Casbin 2.0 + Wire。
一个轻量、灵活、优雅且功能齐全的 RBAC 脚手架,基于 GIN + GORM 2.0 + Casbin 2.0 + Wire DI。基于 Golang + Gin + GORM 2.0 + Casbin 2.0 + Wire。
基于 Golang + Gin + GORM 2.0 + Casbin 2.0 + Wire DI 的轻量级、灵活、优雅且功能齐全的 RBAC 脚手架。
English | 中文
RESTful API,采用接口化编程范式,让您的 API 设计更加专业规范GIN 框架,集成丰富实用的中间件(身份认证、跨域、日志、限流、链路追踪、权限控制、容错、压缩等),助您快速构建企业级应用Casbin 权限框架,灵活精准的 RBAC 权限控制让安全防护固若金汤GORM 2.0 ORM 框架,优雅处理数据库操作,大幅提升开发效率WIRE 依赖注入,革命性地简化模块依赖关系,让代码更加优雅解耦Zap 日志框架,配合 Context 链路追踪,让系统运行状态清晰透明,问题排查无所遁形JWT 认证机制,让用户身份验证更加安全可靠Swagger 接口文档,API 文档实时更新,开发调试更轻松 - 在线体验testify 框架保障系统质量,让 bug 无处藏身go install github.com/google/wire/cmd/wire@latestgo install github.com/swaggo/swag/cmd/swag@latestgo install github.com/gin-admin/gin-admin-cli/v10@latest可通过
gin-admin-cli help new查看命令的详细说明
gin-admin-cli new -d ~/go/src --name testapp --desc 'A test API service based on golang.' --pkg 'github.com/xxx/testapp' --git-url https://gitee.com/lyric/gin-admin.git通过更改
configs/dev/server.toml配置文件中的MenuFile = "menu_cn.json"可以切换到中文菜单
cd ~/go/src/testapp
make start
# or
go run main.go startmake build
# or
go build -ldflags "-w -s -X main.VERSION=v1.0.0" -o testappdocker build -f ./Dockerfile -t testapp:v1.0.0 .可通过
gin-admin-cli help gen查看命令的详细说明
dictionary.yaml…gin-admin-cli gen -d . -m SYS -c dictionary.yaml可通过
gin-admin-cli help remove查看命令的详细说明
gin-admin-cli rm -d . -m CMS --structs Article通过 Swag 可以自动生成 Swagger 文档
make swagger
# or
swag init --parseDependency --generalInfo ./main.go --output ./internal/swagger依赖注入本身的作用是解决了各个模块间层级依赖繁琐的初始化过程,通过 Wire 可以自动生成依赖注入代码,简化依赖注入的过程。
make wire
# or
wire gen ./internal/wirex…扫码加微信群
Copyright (c) 2024 Lyric
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
暂无开放 Issues,或尚未同步最近议题。