Giter Club home page Giter Club logo

tigo's Introduction

Build Status
Tigo logo

一个使用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:  "0.0.0.0",
        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 中有所使用。
如果你对次框架感兴趣,可以加入我们一同开发。

tigo's People

Contributors

karldoenitz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.