Tigo(中文文档点击此处)
A web framework developed in go language.
- tiger
tiger
is a commandline tool forTigo
framework, you can usetiger
to create aTigo
projection.
glance tiger - tission
tission
is a session plugin forTigo
.
glance tission
export GO111MODULE=off;
go get github.com/karldoenitz/Tigo/...
export GO111MODULE=on;
export GO111MODULE=off;
go get -u github.com/karldoenitz/Tigo/...
export GO111MODULE=on;
go get github.com/karldoenitz/Tigo@{version}
package main
import (
"github.com/karldoenitz/Tigo/web"
"net/http"
)
// DemoHandler handler
type DemoHandler struct {
web.BaseHandler
}
func (demoHandler *DemoHandler) Get() {
demoHandler.ResponseAsText("Hello Demo!")
}
// Authorize Middleware
func Authorize(w *http.ResponseWriter, r *http.Request) bool {
return true
}
// Pattern
var urls = []web.Pattern{
{"/demo", DemoHandler{}, []web.Middleware{Authorize}},
}
func main() {
application := web.Application{
IPAddress: "127.0.0.1",
Port: 8888,
UrlPatterns: urls,
}
application.Run()
}
Open terminal, cd to target directory, input the command:
go build main.go
After compiled, there will be a runnable file named main
, input the command:
./main
The info will display in terminal:
INFO 2022/10/07 22:40:36 Server run on: 127.0.0.1:8080
Open web browser and visit http://127.0.0.1:8888/hello-tigo
, you will see Hello Tigo.
If you like the framework, join us please.