Skip to content

Go Framework 公共库,提供常用的工具函数和组件

Notifications You must be signed in to change notification settings

ThingsPanel/go-libs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-libs

Go Framework 公共库,提供常用的工具函数和组件。

安装

go get github.com/ThingsPanel/go-libs

功能模块

HTTP 响应工具

提供标准化的 HTTP 响应处理功能。

使用示例

package main

import (
    "net/http"
    "github.com/ThingsPanel/go-libs/httpt"
)

func handler(w http.ResponseWriter, r *http.Request) {
    data := map[string]string{"message": "Hello World"}
    
    // 成功响应
    httpt.Response(w, data, nil)
    
    // 错误响应
    // httpt.Response(w, nil, errors.New("something went wrong"))
}

许可证

MIT License

About

Go Framework 公共库,提供常用的工具函数和组件

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages