Go語言的一個Web框架:ripple

Ripple

Go語言的一個Web MVC框架(基于Echo)

Which features to include in a framework

A framework has 3 parts. A router receiving a request and directing it to a handler, a middleware system to add reusable pieces of software before and after the handler, and the handler processing the request and writing the response.

  • Router
  • Middlewares
  • Handler processing

[architect]()

Middlewares handle:

  • error/panic
  • logging
  • security
  • sessions
  • cookies
  • body parsing

Features

  • MySQL and Foundation database support
  • Modular (you can choose which components to use)
  • Middleware support, compatible Middleware works out of the box
  • Lightweight. Only MVC
  • Multiple configuration files support (currently json)

Overview

ripple is a lightweight MVC framework. It is based on the principles of simplicity, relevance and elegance.

  • Simplicity. The design is simple, easy to understand and doesn't introduce many layers between you and the standard library. It is a goal of the project that users should be able to understand the whole framework in a single day.
  • Relevance. ripple doesn't assume anything. We focus on things that matter, this way we are able to ensure easy maintenance and keep the system well-organized, well-planned and sweet.
  • Elegance. ripple uses golang best practises. We are not afraid of heights, it's just that we need a parachute in our backpack. The source code is heavily documented, any functionality should be well explained and well tested.

Installation

$ go get github.com/bmbstack/ripple
$ go get github.com/bmbstack/ripple/cmd/ripple
$ go get github.com/bmbstack/ripple/cmd/wbs
$ ripple new rippleApp
$ cd $GOPATH/src/rippleApp
$ wbs -c wbs.toml

Then, Open the url: http://localhost:8090

Project structure

This is the structure of the rippleApp list application that will showcase how you can build web apps with ripple:

├── bin
│   └── forum
├── config
│   └── config.json
├── controllers
│   └── home.go
├── frontend
│   ├── static
│   │   ├── css
│   │   │   └── app.css
│   │   └── js
│   │       └── app.js
│   └── templates
│       └── home
│           ├── html.html
│           └── index.html
├── logger
│   └── logger.go
├── main.go
├── models
│   └── user.go
├── scripts
│   ├── commands.go
│   ├── const.go
│   ├── init.go
│   └── server.go
└── wbs.toml

12 directories, 15 files

Screenshots

ripple new rippleApp Debug mode Release mode Web browser

Acknowledgements

These amazing projects have made ripple possible:

項目地址: https://github.com/bmbstack/ripple

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!