gin-template

command module
v0.0.0-...-4d620b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

介绍

本项目是gin框架的apiserver脚手架项目,预置内容有:

  • 项目模块分层:
    • controller,负责处理对外接口的实现、swagger调用的代码注释
    • docs,swagger项目自定义文档
    • middlewares,中间件模块,纳管gin用到的中间件
      • cors 跨域插件
      • norouter 404插件
      • prom prometheus监控插件
        • 自定义prometheus metrics
      • swagger 接口插件
      • [*] jwt 插件
        • [*] Authroization: Bearer $TOEKN
      • sso 单点登录插件
      • cas 权限认证插件
    • model,统一模型管理文件集
    • router,路由注册模块和插件注册模块
    • utils,功能组件模块
      • Xorm 工具
        • Sqlite3
        • Mysql
        • Pg
        • Redis
      • 缓存
        • ConcurrentMap
    • main.go 项目启动入口文件
    • CLI读取配置文件
      • Cobra
      • Viper
  • 内置前端界面管理模块
    • 前端动态页面权限
    • 基于jwt的前后端接口联调功能

本项目旨在解决项目搭建重复劳动的问题,并整合框架和常用插件,快速项目启动并避免每次新项目扣脑壳的问题。

使用说明

命令模式:

git clone https://github.com/lflxp/gin-template

cd gin-template && go run main.go

一键运行:

git clone https://github.com/lflxp/gin-template

cd gin-template && make

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

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.0

Unless 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.

Directories

Path Synopsis
prometheus中间件
prometheus中间件
jwt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL