Tigo

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2018 License: MIT

README

Build Status Open Source Helpers Go Report Card GoDoc Release
Tigo logo

Tigo(For English Documentation Click Here)

一个使用Go语言开发的web框架。

安装

go get github.com/karldoenitz/Tigo/...

示例

Hello Tigo

package main

import "github.com/karldoenitz/Tigo/TigoWeb"

// handler
type HelloHandler struct {
    TigoWeb.BaseHandler
}

func (helloHandler *HelloHandler)Get() {
    helloHandler.ResponseAsHtml("<p1 style='color: red'>Hello Tigo!</p1>")
}

// url路由配置
var urls = map[string]interface{}{
    "/hello-tigo": &HelloHandler{},
}

// 主函数
func main() {
    application := TigoWeb.Application{
        IPAddress:  "127.0.0.1",
        Port:       8888,
        UrlPattern: urls,
    }
    application.Run()
}
编译

打开终端,进入代码目录,运行如下命令:

go build main.go
运行

编译完成后,会有一个可执行文件main,运行如下命令:

./main

终端会有如下显示:

INFO: 2018/07/09 15:02:36 Application.go:22: Server run on: 0.0.0.0:8888

打开浏览器访问地址http://127.0.0.1:8888/hello-tigo,就可以看到Hello Tigo。

文档

点击此处 文档站点

注意

这个框架在Linux版本的 CubeBackup for Google Apps 中有所使用。
如果你对此框架感兴趣,可以加入我们一同开发。

Directories

Path Synopsis
Package TigoWeb Copyright 2018 The Tigo Authors.
Package TigoWeb Copyright 2018 The Tigo Authors.
Package binding 提供了一个非常简单的json校验功能,目前功能有限,仅支持几种基本类型的校验。
Package binding 提供了一个非常简单的json校验功能,目前功能有限,仅支持几种基本类型的校验。
demo
GetParams command
HelloWorld command
main command
Package logger Copyright 2018 The Tigo Authors.
Package logger Copyright 2018 The Tigo Authors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL