Go 语言的 Web 服务框架 Gear-go

码农软件 · 软件分类 · Web框架 · 2019-03-25 21:14:53

软件介绍

Gear 是 Go 语言下的一个轻量级、可组合、高性能的 Web 服务框架。由 Teambition 开发,用于开发 SOA 服务层。其设计参考了 Go 生态下现有的近十款 Web 框架和 Node.js 生态的 koaToa 等框架。

Demo

package main

import (
    "fmt"
    "os"

    "github.com/teambition/gear"
    "github.com/teambition/gear/logging"
)

func main() {
    app := gear.New()

    // Add logging middleware
    app.UseHandler(logging.Default())

    // Add router middleware
    router := gear.NewRouter()
    router.Use(func(ctx *gear.Context) error {
        // do some thing.
        fmt.Println("Router middleware...", ctx.Path)
        return nil
    })
    router.Get("/", func(ctx *gear.Context) error {
        return ctx.HTML(200, "<h1>Hello, Gear!</h1>")
    })
    app.UseHandler(router)
    app.Error(app.Listen(":3000"))
}

本文地址:https://codercto.com/soft/d/2152.html

Eric Meyer on CSS

Eric Meyer on CSS

Eric Meyer / New Riders Press / 2002-7-8 / USD 55.00

There are several other books on the market that serve as in-depth technical guides or reference books for CSS. None, however, take a more hands-on approach and use practical examples to teach readers......一起来看看 《Eric Meyer on CSS》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具