command
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Sep 25, 2022
License: MIT
Opens a new window with license information.
Imports: 14
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
模板特点
模板集成了一个基于 gin 的后端项目通常需要使用的基础框架,具体有:
- 集成 pflag + viper 统一配置管理,同时支持命令行参数
- 集成 gorm ORM 框架, 默认 MySQL 连接
- 基于 cron 的定时任务框架
- 预置中间件和api版本管理,基于 gin-swagger 的api文档
- 内置 Dockerfile + Makefile 镜像、二进制构建
- 基于
github-workflow
的自动镜像构建
使用方法
初始化过程仅支持MacOS和Linux, 其他系统请参考 init.sh
自行手动修改。
-
1、在 github
页面创建仓库选择使用该模板
-
2、在本地初始化项目
git clone <你从模板创建的仓库>
cd <项目下>
make init # 按提示输入一个module
# 下载依赖开始开发
go mod download
自动构建
基于 github-workflow 自动构建镜像推送到 docker仓库, 当前main分支推送和tag事件自动触发
Account Settings -> Security -> New Access Token, 权限选择 Read/Write
项目 -> Settings -> Secrets -> Actions -> New repository secret,创建两个键值对:
DOCKER_HUB_NAME
值是docker用户名
DOCKER_HUB_TOKEN
值是第一步创建的密钥
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
|
|
|
|
v1
Package v1 GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
|
Package v1 GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag |
v2
Package v2 GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
|
Package v2 GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag |
|
|
|
|
pkg
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.