Skip to content

Latest commit

 

History

History
118 lines (101 loc) · 4.07 KB

README_EN.md

File metadata and controls

118 lines (101 loc) · 4.07 KB

Badge LICENSE Go Join the chat at https://gitter.im/karlooper/Tigo Open Source Helpers Go Report Card GoDoc Release
Tigo logo

A web framework developed in go language.

Plugins and Tools for Tigo

  • tiger
    tiger is a commandline tool for Tigo framework, you can use tiger to create a Tigo projection.
    glance tiger
  • tission
    tission is a session plugin for Tigo.
    glance tission

Install

export GO111MODULE=off; 
go get github.com/karldoenitz/Tigo/...
export GO111MODULE=on; 

Update

export GO111MODULE=off; 
go get -u github.com/karldoenitz/Tigo/...
export GO111MODULE=on; 

Update to defined version

go get github.com/karldoenitz/Tigo@{version}

Demo

Hello Tigo

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()
}

Compile

Open terminal, cd to target directory, input the command:

go build main.go

Run

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 https://127.0.0.1:8888/hello-tigo, you will see Hello Tigo.

Performance Comparison

Performance Comparison

Documentation

Click Here

Users of Tigo

CubeBackup Tencent Xiaomi

Special Thanks

Jetbrains

Attention

If you like the framework, join us please.