https://github.com/sahil-gulati/goose
GoLang framework for building REST API
https://github.com/sahil-gulati/goose
go golang golang-framework goose http
Last synced: 24 days ago
JSON representation
GoLang framework for building REST API
- Host: GitHub
- URL: https://github.com/sahil-gulati/goose
- Owner: Sahil-Gulati
- Created: 2019-08-02T02:06:07.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-08T15:04:04.000Z (about 5 years ago)
- Last Synced: 2025-12-18T10:52:18.824Z (6 months ago)
- Topics: go, golang, golang-framework, goose, http
- Language: Go
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Goose
GoLang framework for building REST API. It requires a bare minimum code to start a server by offering fast development of REST based APIs.
### Usage
`go get -v -u https://github.com/Sahil-Gulati/Goose`
### Sample code
```go
func main() {
Goose := goose.Goose{}.GetInstance()
Goose.Route([]string{goose.GET}, "/api/v1/transactions/").Middlewares(m1, m2).Endpoint(endpoint).Register()
Goose.Serve(":8080")
}
```
### Middleware
##### Middleware signature
```go
type GooseMiddleware func(*http.Request, *GooseMessage) (bool, *GooseResponse)
```
### Endpoint
##### Endpoint signature
```go
type GooseEndpoint func(*http.Request, *GooseMessage) interface{}
```
### Message
##### Message signature
```go
type GooseMessage struct {
RequestId int64
RequestTime int64
PostBody string
Holder interface{}
RequestHeaders map[string]string
GetParams map[string]string
UrlParams map[string]string
}
```