Coder Social home page Coder Social logo

trendingtechnology / dragon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from go-dragon/dragon

0.0 1.0 0.0 79.3 MB

Dragon 🐲 🐲 🐲 is an enterprise high performance web framework with Go for the feature and comfortable develop.

License: Apache License 2.0

Dockerfile 1.38% Go 98.62%

dragon's Introduction

Dragon

CI Status

Dragon 🐲 🐲 🐲 is a lightweight high performance web framework with Go for the feature and comfortable develop.

δΈ­ζ–‡ζ–‡ζ‘£

components

  1. httprouter. HttpRouter is a lightweight high performance HTTP request router.
  2. GORM. The fantastic ORM library for Golang, aims to be developer friendly.
  3. util. for golang common util.
  4. validator. google validator to validate the data.
  5. erro. erro pkg aims to wrap the error stack.

start dragon

dragon is DDD go framework. So you can hack with handler domain(entity,repository,service).

  1. config your yml, first config dev.yml config:

dir core/dragon/conf/config/xxx.yml, dev.yml/prod.yml/test.yml/..*** or you can set env DRAGON in docker

  1. build && run your app
cd dragon
go build main.go && mv main ./release/ && ./release/main

move your main(exec file) to release dir

  1. IDE config if you use goland ide, can set
Output directory: <project_dir>/release
Working directory: <project_dir>/release

Because default dragon exec (elf) file output in release dir, so the dirs are resolved according to release dir.

After that, feel free to run your app and start hacking :)

  1. deployment you can deploy your app in different environments, only change environment DRAGON, for example. that supports docker.
export DRAGON=dev
export DRAGON={env}

ab performance

cpu: 4 core, ram: 8 G
Server Software:        nginx/1.12.2
Server Hostname:        test.com
Server Port:            80

Document Path:          /
Document Length:        13 bytes

Concurrency Level:      100
Time taken for tests:   9.341 seconds
Complete requests:      100000
Failed requests:        0
Write errors:           0
Total transferred:      17700000 bytes
HTML transferred:       1300000 bytes
Requests per second:    73749.75 [#/sec] (mean)
Time per request:       9.341 [ms] (mean)
Time per request:       0.093 [ms] (mean, across all concurrent requests)
Transfer rate:          1850.51 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   1.2      1       9
Processing:     0    8   2.7      8      30
Waiting:        0    7   2.5      6      29
Total:          0    9   2.9      9      31

Percentage of the requests served within a certain time (ms)
  50%      9
  66%     10
  75%     11
  80%     11
  90%     13
  95%     14
  98%     16
  99%     18
 100%     31 (longest request)

app will read DRAGON env first to check prod,dev or test mode

build:

Just compile your src file and move bin file to directory dragon/release/

you might develop with fswatch for hot rebuilding. just create .fsw.json config:

{
 "desc": "Auto generated by fswatch [dragon]",
 "triggers": [
   {
     "name": "",
     "pattens": [
       "**/*.go"
     ],
     "env": {
       "DEBUG": "1"
     },
     "cmd": "go fmt dragon... && go build -o ./release/dragon && ./release/dragon",
     "shell": true,
     "delay": "100ms",
     "stop_timeout": "500ms",
     "signal": "KILL",
     "kill_signal": ""
   }
 ],
 "watch_paths": [
   "."
 ],
 "watch_depth": 10
}

just run cmd

$ fswatch

dragon's People

Contributors

azerothyang avatar super-boom avatar

Watchers

 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.