Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sniper

> 编程语言
Open source

轻量级 go 业务框架

1.3K stars0 likes0 views
WebsiteGitHub

About

轻量级 go 业务框架

Sniper 轻量级业务框架

Sniper 是一套轻量级但又很现代化的业务框架。轻量体现在只集成了最必要的功能,现代 则体现在接口描述IDL、可观测、强大的脚手架等方面。

Sniper 框架从 2018 年开发并开源,在我们业务生产环境平稳运行,至少可以应对五百万 DAU量级的业务。我们也不断把多年的生产实践经验固化到 Sniper 框架,希望能帮助更多 的朋友。

有兴趣的同学也可以加我的微信taoshu-in我拉大家进群讨论。

系统要求

Sniper 仅支持 UNIX 环境。Windows 用户需要在 WSL 下使用。

环境准备好之后,需要安装以下工具的最新版本:

  • go
  • git
  • make
  • protoc

快速入门

安装 sniper 脚手架:

bash
go install github.com/go-kiss/sniper/cmd/sniper@latest

创建一个新项目:

bash
sniper new --pkg helloworld

切换到 helloworld 目录。

运行服务:

bash
CONF_PATH=`pwd` go run main.go http

使用 httpie 调用示例接口:

bash
http :8080/foo.v1.Bar/Echo msg=hello

应该会收到如下响应内容:

HTTP/1.1 200 OK
Content-Length: 15
Content-Type: application/json
Date: Thu, 14 Oct 2021 09:49:16 GMT
X-Trace-Id: 08c408b0a4cd12c0

{
    "msg": "hello"
}

深入理解

Sniper 框架几乎每一个目录下都有 README.md 文件,建议仔细阅读。

如需了解 Sniper 框架的工作原理和设计原则,请移步我的博客。

赞助商

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gogogolanggolang-frameworkgrpc

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言