https://github.com/goa-go/goa
Goa is a web framework based on middleware, like koa.js.
https://github.com/goa-go/goa
framework goa golang middleware
Last synced: 10 days ago
JSON representation
Goa is a web framework based on middleware, like koa.js.
- Host: GitHub
- URL: https://github.com/goa-go/goa
- Owner: goa-go
- License: mit
- Created: 2019-07-26T07:12:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-06T10:29:45.000Z (about 6 years ago)
- Last Synced: 2024-11-17T22:36:27.620Z (over 1 year ago)
- Topics: framework, goa, golang, middleware
- Language: Go
- Homepage: https://goa-go.github.io
- Size: 109 KB
- Stars: 49
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - goa - goa is just like koajs for golang, it is a flexible, light, high-performance and extensible web framework based on middleware. (Web Frameworks / Utility/Miscellaneous)
- awesome-go-cn - goa
- awesome-go - goa - goa is just like koajs for golang, it is a flexible, light, high-performance and extensible web framework based on middleware. (Web Frameworks / Utility/Miscellaneous)
- awesome-go-info - goa - performance and extensible web framework based on middleware. | (Utility)
- go-awesome-with-star-updatetime - goa - goa is just like koajs for golang, it is a flexible, light, high-performance and extensible web framework based on middleware. (Web Frameworks / HTTP Clients)
- awesome-go-extra - goa - 07-26T07:12:23Z|2019-12-06T10:29:45Z| (Web Frameworks / Fail injection)
- awesome-go - goa - goa is just like koajs for golang, it is a flexible, light, high-performance and extensible web framework based on middleware. (Web Frameworks / Utility/Miscellaneous)
- awesome-Char - goa - goa is just like koajs for golang, it is a flexible, light, high-performance and extensible web framework based on middleware. (Web Frameworks / HTTP Clients)
- awesome-go - goa - goa is just like koajs for golang, it is a flexible, light, high-performance and extensible web framework based on middleware. (Web Frameworks / HTTP Clients)
- awesome-go-cn - goa - go/goa) [![godoc][D]](https://godoc.org/github.com/goa-go/goa) (Web框架 / 实用程序/Miscellaneous)
- awesome-go - goa - goa is just like koajs for golang, it is a flexible, light, high-performance and extensible web framework based on middleware. (Web Frameworks / Utility/Miscellaneous)
README
# Goa
[](https://travis-ci.org/goa-go/goa)
[](https://codecov.io/github/goa-go/goa?branch=master)
[](http://godoc.org/github.com/goa-go/goa)
[](https://goreportcard.com/report/github.com/goa-go/goa)
[](https://github.com/avelino/awesome-go)
[](https://github.com/goa-go/goa/pull/new)
Goa is under construction, if you are familiar with [koa](https://github.com/koajs/koa) or go and interested in this project, please join us.
## What is goa?
goa = go + [koa](https://github.com/koajs/koa)
Just like koa, goa is also not bundled with any middleware. But you can expand functionality to meet your needs at will by middlware. It is flexible, light, high-performance and extensible.
## Installation
```bash
$ go get -u github.com/goa-go/goa
```
## Hello Goa
```go
func main() {
app := goa.New()
app.Use(func(c *goa.Context) {
c.String("Hello Goa!")
})
log.Fatal(app.Listen(":3000"))
}
```
## Middleware
Goa is a web framework based on middleware.
Here is an example of using goa-router and logger.
```go
package main
import (
"fmt"
"log"
"time"
"github.com/goa-go/goa"
"github.com/goa-go/router"
)
func logger(c *goa.Context) {
start := time.Now()
fmt.Printf(
"[%s] <-- %s %s\n",
start.Format("2006-01-02 15:04:05"),
c.Method,
c.URL,
)
c.Next()
fmt.Printf(
"[%s] --> %s %s %d %s\n",
time.Now().Format("2006-01-02 15:04:05"),
c.Method,
c.URL,
time.Since(start).Nanoseconds()/1e6,
"ms",
)
}
func main() {
app := goa.New()
r := router.New()
r.GET("/", func(c *goa.Context) {
c.String("Hello Goa!")
})
app.Use(logger)
app.Use(r.Routes())
log.Fatal(app.Listen(":3000"))
}
```
If you are unwilling to use goa-router, you can make a custom router middleware as you like.
## Maintainers
[@NicholasCao](https://github.com/NicholasCao).
## License
[MIT](https://github.com/goa-go/goa/blob/master/LICENSE)