Giter Club home page Giter Club logo

sniper's Introduction

Sniper 轻量级业务框架

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

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

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

系统要求

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

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

快速入门

安装 sniper 脚手架:

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

创建一个新项目:

sniper new --pkg helloworld

切换到 helloworld 目录。

运行服务:

CONF_PATH=`pwd` go run main.go http

使用 httpie 调用示例接口:

http :8080/api/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 框架的工作原理和设计原则,请移步我的博客

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.