Git Product home page Git Product logo

gin-framework's Introduction

gin-framework

启动方式

go run main.go -t [web,cron,rpc,all]

目录说明

├── README.md
├── app
├── boot
├── configs
├── go.mod
├── go.sum
├── helpers
├── main.go
├── resources
└── routes

测试url

air
[GIN-debug] GET    /v1/test                  --> gitee.com/zhenyangze/gin-framework/app/modules/index/handlers.TestHandle (5 handlers)
[GIN-debug] GET    /v1/view/:name/*action    --> gitee.com/zhenyangze/gin-framework/app/modules/index/handlers.ViewHandle (5 handlers)
[GIN-debug] GET    /v1/view                  --> gitee.com/zhenyangze/gin-framework/app/modules/index/handlers.ViewHandle (5 handlers)
[GIN-debug] POST   /v1/valid                 --> gitee.com/zhenyangze/gin-framework/app/modules/index/handlers.ValidHandle (5 handlers)
[GIN-debug] GET    /v1/ormmiddle             --> gitee.com/zhenyangze/gin-framework/app/middleware.CachePage.func1 (5 handlers)
[GIN-debug] GET    /v1/ormcache              --> gitee.com/zhenyangze/gin-framework/app/modules/index/handlers.OrmWithCacheHandle (5 handlers)
[GIN-debug] GET    /v1/orm                   --> gitee.com/zhenyangze/gin-framework/app/modules/index/handlers.OrmHandle (5 handlers)
[GIN-debug] GET    /v1/redis                 --> gitee.com/zhenyangze/gin-framework/app/modules/index/handlers.RedisHandle (5 handlers)
[GIN-debug] GET    /v1/md5/:str              --> gitee.com/zhenyangze/gin-framework/app/modules/index/handlers.Md5Handle (5 handlers)
[GIN-debug] GET    /                         --> gitee.com/zhenyangze/gin-framework/app/modules/index/handlers.MyHandle (4 handlers)
[GIN-debug] POST   /login                    --> github.com/appleboy/gin-jwt/v2.(*GinJWTMiddleware).LoginHandler-fm (4 handlers)
[GIN-debug] GET    /auth/refresh_token       --> github.com/appleboy/gin-jwt/v2.(*GinJWTMiddleware).RefreshHandler-fm (4 handlers)
[GIN-debug] GET    /auth/hello               --> gitee.com/zhenyangze/gin-framework/app/modules/users/handlers.UsersHandler (5 handlers)
[GIN-debug] GET    /ws                       --> gitee.com/zhenyangze/gin-framework/app/modules/websockets/handlers.WebSocketHandle (4 handlers)

jwt

Login api

http -v --json POST localhost:8000/login username=admin password=admin
POST /login HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 42
Content-Type: application/json
Host: localhost:8080
User-Agent: HTTPie/2.2.0

{
    "password": "admin",
    "username": "admin"
}

HTTP/1.1 200 OK
Content-Length: 212
Content-Type: application/json; charset=utf-8
Date: Wed, 21 Oct 2020 06:36:46 GMT
X-Request-Id: 8b70b5ac-324a-4750-bd87-1a3bf63bd851

{
    "code": 200,
    "expire": "2020-10-21T15:36:46+08:00",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MDMyNjU4MDYsImlkIjoiYWRtaW4iLCJvcmlnX2lhdCI6MTYwMzI2MjIwNn0.meMbQK1RL_O1AmRT6Rm3fIfCnlbnkKexO-picpjLH4c"
}

Authorization

http -f GET localhost:8000/auth/hello "Authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MDMyNjU4MDYsImlkIjoiYWRtaW4iLCJvcmlnX2lhdCI6MTYwMzI2MjIwNn0.meMbQK1RL_O1AmRT6Rm3fIfCnlbnkKexO-picpjLH4c"  "Content-Type: application/json"
HTTP/1.1 200 OK
Content-Length: 59
Content-Type: application/json; charset=utf-8
Date: Wed, 21 Oct 2020 06:37:32 GMT
X-Request-Id: ed3e2c12-c71f-4de6-9bf7-08b09049fd85

{
    "text": "Hello World.",
    "userID": "admin",
    "userName": "admin"
}

功能组件

  • 缓存

  • 事件

  • 邮件

  • GORM

  • Redis

  • 中间件(限流,header,pageCache,RequestId)

  • Cron

  • JWT

gin-framework's People

Contributors

zhenyangze avatar

Watchers

 avatar  avatar

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.