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://www.codercto.com/soft/d/2152.html

The Web Application Hacker's Handbook

The Web Application Hacker's Handbook

Dafydd Stuttard、Marcus Pinto / Wiley / 2011-9-27 / USD 50.00

The highly successful security book returns with a new edition, completely updated Web applications are the front door to most organizations, exposing them to attacks that may disclose personal infor......一起来看看 《The Web Application Hacker's Handbook》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

SHA 加密
SHA 加密

SHA 加密工具