package
0.0.0-20220831041312-728cb04bfefc
Repository: https://github.com/gothinkster/golang-gin-realworld-example-app.git
Documentation: pkg.go.dev

# Functions

You can custom middlewares yourself as the doc: https://github.com/gin-gonic/gin#custom-middleware r.Use(AuthMiddleware(true)).
Migrate the schema of database if needed.
You could input the conditions and it will return an UserModel in database with error info.
You can put the default value of a Validator here.
You can put the default value of a Validator here.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
You could input an UserModel which will be saved in database returning with error info if err := SaveOne(&userModel); err != nil { ..
A helper to write user_id and user_model to the context.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

Extract token from Authorization header Uses PostExtractionFilter to strip "TOKEN " prefix from header.
Extractor for OAuth2 access tokens.

# Structs

A hack way to save ManyToMany relationship, gorm will build the alias as FollowingBy <-> FollowingByID <-> "following_by_id".
No description provided by the author
Declare your response schema here.
No description provided by the author
Models should only be concerned with database schema, more strict checking should be put in validator.
*ModelValidator containing two parts: - Validator: write the form/json checking rule according to the doc https://github.com/go-playground/validator - DataModel: fill with data from Validator after invoking common.Bind(c, self) Then, you can just call model.save() after the data is ready in DataModel.
No description provided by the author
No description provided by the author