Giter Club home page Giter Club logo

ginframe's Introduction

[TOC]- 关于我

关于我

执着于理想,纯粹与当下...

ginframe

基于Go语言gin框架搭建的可快速开发的微服务脚手架

简介

基于gin框架,搭建一个快速开发的脚手架。

目录结构

server-common                         -- 服务公共模块
    config                            -- 解析配置方法
    const                             -- 全局常量
    driver                            -- 全局驱动
    nacosRF                           -- 全局nacos配置
    pkg                               -- 全局公共包
        gorm
        httprequest
        jwt
        leveldb
        mongo
        redis
        uber
        viper
        wetcd
        wkafka
    process                           -- cpu核心
    servers                           -- gprc 服务发现
    utils                             -- 全局工具类
        email                         -- 发送邮件
        encry                         -- 加密
        enum                          -- api统一分装返回
        ip                            -- ip工具
        maps                          -- map工具
        orm                           -- gorm动态搜索、分页
        regmatch                      -- 正则匹配
        slice                         -- 切片操作
        wordsfilter                   -- 敏感词过滤
        wtime                         -- 时间处理
server-user                           -- 用户服务
    boot                              -- 启动目录
        db.go
        grpc.go
        http.go
        init.go
        log.go
        ws.go
    cachedb                           -- 缓存操作
    core                              -- 核心目录
        db.go
    daos                              -- daos
    global                            -- user服务全局配置
    grpcservices                      -- grpc services
    handler                           -- 控制器
    input                             -- 入参
    middlewares                       -- 中间件
    models                            -- 模型
    out                               -- 出参映射
    pb                                -- protobuf生成的文件目录
    proto                             -- protobuf文件目录
    router                            -- 路由
        api.go
        ws.go
    rpc                               -- rpc
    scripts                           -- 脚本
    service                           -- 服务层
    ulogger                           -- 服务日志
    ws                                -- websocket
    main.go                           -- 入口文件
server-test                           -- 测试服务
......                                -- 其他服务
.gitignore
go.mod                                -- mod包管理文件
LICENSE
README.md

安装

安装完之后名字ginframe可改,可根据自己的需求精简或者添加架子结构。也可直接使用

git clone https://github.com/jeffcail/ginframe.git

cd ginframe

make env

make mod

目的及优势

  • 快速上手、快速开发、快速交付
  • 高性能、高扩展,避免重复造轮子

职责

快速开发、避免重复造轮子

文件配置

application.yml为主配置文件.ConfigRemote觉得是否启用远程配置,支持Nacos. config.yml 为应用配置

api路由

http路由

rpc

websocket路由

websocket路由

api返回统一格式

成功、失败、分页

gorm

redis

Mongo

uber.zap.log

GOMAXPROCS

httprequest

http请求. GET、POST带header头和参数

leveldb

ElasticSearch

AES

可用于api接口参数加密

加密

md5加密 、sha256加密 、sha512加密 、文件md5加密 、 (密码+盐)hash加密(可以用于加密登录密码).

动态搜索+分页

map合并和并发安全map

时间处理工具类

邮件类工具

kafka生产者、消费者

etcd客户端连接初始化 (写入、读取、修改、删除)

jwt

登录签发token

token校验中间件

账号登录状态是否被禁用校验中间件

常用正则表达式

  1. 手机号
  2. 座机号
  3. 18位身份证号
  4. 护照编号
  5. 港澳通行证
  6. IP地址(ipv4)
  7. IPV6
  8. MAC地址
  9. 电子邮箱
  10. 统一社会信用代码
  11. 密码
  12. 网址URL 带端口号
  13. 网址URL 不带端口号
  14. 金额

数组切片去重

ginframe's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ginframe's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.