What is console-core-go?
console-core-go
is a modular design API framework based on Gin, which encapsulates commonly used functions, is simple to use, and is committed to fast business Research and development, while adding more restrictions, restrict the development members of the project team, avoid chaos, disorder and free and arbitrary coding.
Features:
- Rate-limited APIs supported by rate
- Email notification when panic occurs
- Cross-Origin Resource Sharing supported by cors
- Metrics monitoring and alerting by Prometheus
- Automatically generate RESTful API documentation supported by Swagger
- Trace project internal invoking
- Visualized performance analysis supported by pprof
- Uniformly defined error codes supported by err-no
- Blazing fast, structured, leveled logging system by zap
- Complete configuration solution supported by viper
- Developer Friendly ORM library supported by gorm
- Redis supported by go-redis
- Standard RESTful API return value
- CURD code generator , controller generator, etc.
work steps
go run -v .\cmd\mysqlmd\main.go -addr 127.0.0.1:3306 -name hi_node -user root -pass ""
#touch %GOPATH%\bin\.env #GO_GORM_MONGO=0/1
go build -o gormgen .\cmd\gormgen\main.go
del %GOPATH%\bin\gormgen.exe
move gormgen %GOPATH%\bin\gormgen.exe
go generate ./...
# modify %GOPATH%\bin\.env, change GO_GORM_MONGO=1 then run go generate ./... again
# GO_GORM_MONGO=0 generate mysql code, GO_GORM_MONGO=1, generate mongo code
#go run -v .\cmd\mfmt\main.go
#only auto generated code need to format
#go run -v .\cmd\mfmt\main.go -src ./
go run -v .\cmd\mfmt\main.go -src ./internal/repository/mysql
go run -v .\cmd\mfmt\main.go -src ./internal/repository/mongo
go run -v .\cmd\mfmt\main.go -src ./internal/repository/model
go install github.com/swaggo/swag/cmd/swag@v1.16.3
swag init
websocket hub
https://github.com/eleven26/go-pusher
winipcfg is copying from:
golang.zx2c4.com/wireguard/windows
golang.zx2c4.com/wireguard/windows/tunnel/winipcfg