Skip to content

coco-roll/ekgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 简体中文 #####Contact QQ Group:68667333

-Front-end UI framework: element-ui -Background framework: gin -Orm framework: gorm -Casbin authentication: [casbin] (https://gin-gonic.com/zh-cn/docs) -Cache: cache -Configuration: go-ini -Go module proxy: goproxy

1. Basic introduction

Ekgo is a friendly web framework developed based on gin. It integrates jwt login authentication, dynamic routing, casbin authority authentication, code generator, highly code decoupled, self Define data validators, language packs, LRU algorithm cache libraries, and coroutine-based queues, allowing you to focus more time on business development.

2. Instructions

-node version> v8.6.0
-golang version >= v1.11
-IDE recommendation: Goland

2.1 server

# Use go.mod

#Enable module support
SET GO111MODULE=on

#GOPROXY environment variable set by the wall
SET GOPROXY=https://goproxy.cn,https://mirrors.aliyun.com/goproxy/,https://goproxy.io,direct

# Install go dependencies
go mod tidy

# Run
go run main

# Cross compile Linux environment
SET GOOS=linux

# Compile
go build main

# Download hot compilation
go get github.com/silenceper/gowatch

#unit test
go test -v -cover

# Run hot compilation
gowatch

2.2 swagger automation API documentation

2.2.1 Install swagger

``##

Download

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

Initialize

swagger swag init ``''

2.3 Service Deployment

Or use screen, Supervisor, systemctl, tmux and other daemons to start

####The log output of the nohup deployment can be subcontracted using the log method ## #Switch to the project root directory and set executable permissions, use nohup demo here nohup ./main & #Hot update off kill -l main #Force close pkill main ''

3. EKGO directory structure

    ├─ekgo (framework folder)
    │ ├─app (the directory contains the core code of the application)
    │ ├─├─admin (controller, almost all the logic to handle the request to enter the application is placed in this directory)
    │ ├─├─common (public interface)
    │ ├─├─middleware (middleware)
    │ ├─├─model (data model configuration)
    │ ├─├─queue (asynchronous queue task)
    │ ├─├─service (interface service layer, generally used to encapsulate data interface operations)
    │ ├─├─validate (data verification)
    │ ├─boot (the directory contains the boot frame)
    │ ├─├─cache (cache)
    │ ├─├─casbin (casbin authentication)
    │ ├─├─config (configuration)
    │ ├─├─db (database setting)
    │ ├─├─logger (log setting)
    │ ├─├─router (route registration)
    │ ├─├─serve (program start service, can be used to start multiple services)
    │ ├─├─validate (validator, can be used for data data parameter verification)
    │ ├─config (configuration file)
    │ ├─docs (swagger document directory)
    │ ├─lib (public function package, does not include the realization of business requirements.)
    │ ├─resource (resource)
    │ ├─router (the directory contains all route definitions of the application)

About

A friendly web framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages