Skip to content

tx7do/gin-ent-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gin-ent-example

Example application of Gin (Go web framework) and Ent (ORM).

Setup A Go Environment

$ go mod tidy

Install entc

$ go install entgo.io/ent/cmd/entc

Create Your Schema

# Run `entc init` from the root directory of the project as follows:
$ entc init User

Generate Code

# Run `go generate` from the root directory of the project as follows:
$ go generate ./ent

Schema describe

$ entc describe ./ent/schema

Install swag

$ go get -u github.com/swaggo/swag/cmd/swag

Build and Run

$ go mod tidy
$ go run main.go

and now you can visit this url for the test of API: http://localhost:8088/swagger/index.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages