Coder Social home page Coder Social logo

zlsgo's Introduction

English | 简体中文

go.dev reference flat Build Status Go Report Card codecov

luckything

文档

查看文档

建议搭配 zzzzzz watch 指令使用

特性

简单易用、足够轻量,避免过多的外部依赖,最低兼容 Window 7 等老系统

快速上手

安装

$ go get github.com/sohaha/zlsgo

HTTP 服务

// main.go
package main

import (
    "github.com/sohaha/zlsgo/znet"
)

func main(){
    // 获取一个实例
    r := znet.New()

    // 注册路由
    r.GET("/hi", func(c *znet.Context) {
        c.String(200, "Hello world")
     })
    // 隐性路由(结构体绑定)请参考文档
    // 启动
    znet.Run()
}

znet

日志工具

zlog

package main

import (
    "github.com/sohaha/zlsgo/zlog"
)

func main(){
    logs := []string{"这是一个测试","这是一个错误"}
    zlog.Debug(logs[0])
    zlog.Error(logs[1])
    zlog.Dump(logs)
    // zlog...
}

HTTP 客户端

// main.go
package main

import (
    "github.com/sohaha/zlsgo/zhttp"
    "github.com/sohaha/zlsgo/zlog"
)

func main(){
    data, err := zhttp.Get("https://github.com")
    if err != nil {
      zlog.Error(err)
      return
    }
    res := data.String()
    zlog.Debug(res)

}

更多功能

请阅读文档 https://docs.73zls.com/zls-go/#

Todo

  • HTTP 服务端
  • Http 客户端
  • 日志功能
  • Json 处理
  • 字符串处理
  • 验证器
  • 热重启
  • 守护进程
  • 异常上报
  • 终端应用
  • 数据库操作
  • ...

LICENSE

MIT

zlsgo's People

Contributors

sohaha avatar seekwe avatar

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.