https://github.com/byte-power/rockgo
Framework for build web application, focus on improve develop speed and software quality.
https://github.com/byte-power/rockgo
golang iris-go webframework
Last synced: about 2 months ago
JSON representation
Framework for build web application, focus on improve develop speed and software quality.
- Host: GitHub
- URL: https://github.com/byte-power/rockgo
- Owner: byte-power
- License: mit
- Created: 2019-12-21T07:01:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-20T05:54:37.000Z (over 4 years ago)
- Last Synced: 2025-03-25T18:45:31.598Z (2 months ago)
- Topics: golang, iris-go, webframework
- Language: Go
- Homepage:
- Size: 86.9 KB
- Stars: 16
- Watchers: 9
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# RockGo Application Framework
RockGo is fast, simple application framework for Go.
RockGo is agent to iris, fluentd, statsd, zap and sentry too. It make easy to build perfect application or service.
## Features
* Application
* [x] Service, ServiceGroup
* [x] Config
* [x] Basic middleware
* Access log
* recover & metric
* [x] Logger integration
* [x] Metric (Stats)
* [x] Sentry
* Log
* [x] Logger, Output, Format
* [x] zap
* [x] fluent
* Crypto
* [x] AES
* [x] Digest (MD5, SHA1/256/512)
* [x] RSA
* Example
* [x] Route - Application, Config
* [ ] Metric & Sentry## Example
Please visit [example](/tree/master/_example).## Install
* go get
```
$ go get github.com/byte-power/rockgo
```
* Add import
```go
import "github.com/byte-power/rockgo/rock"
```
* Add config file named "rockgo.yaml" for internal modules on your settings directory
```yaml
app_name: myapp
log:
LoggerName:
console:
fluent:
level: info
host: "myfluenthost.com"
port: 24224
async: true
metric:
host: "127.0.0.1:8125"
sentry:
dsn: "http://[email protected]/1"
repanic: true
```* Append routes, middlewares and then Run server
```go
func main() {
// load each config file include rockgo.yaml in the directory to create Application
app, err := rock.NewApplication("settings")
if err != nil {
panic(err)
}
// register route handler with Service
app.Serve("root", "/").Get(func(ctx iris.Context) {
ctx.StatusCode(http.StatusOK)
ctx.Text("Hello RockGo")
})
groupArt := app.ServeGroup("article", "/arts")
groupArt.Use(/* append middleware working on the group only, e.g. authentication */)
groupArt.Serve("root", "/").Get(func(ctx iris.Context) {
// do something to response /arts/
})
err = app.Run(":8080")
if err != nil {
panic(err)
}
}
```## License
MIT