Categorygithub.com/sohaha/zlsgo
modulepackage
1.7.17
Repository: https://github.com/sohaha/zlsgo.git
Documentation: pkg.go.dev

# README

English | 简体中文

GitHub tag (latest SemVer) flat go.dev reference UnitTest Go Report Card codecov

luckything

Golang daily development common function library

Documentation

Check out the documentation

Recommended to use with the zzz watch command of zzz

Why Zara

Simple and easy to use, lightweight enough to avoid excessive external dependencies, minimum compatible with old systems such as Window 7.

QuickStart

Install

$ go get github.com/sohaha/zlsgo

HTTP Service

// 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")
     })
    // Implicit routing (struct binding) please refer to the document
    znet.Run()
}

znet

Logger

package main

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

func main(){
    zlog.Debug("This is a debug")
    zlog.Error("This is a error")
    // zlog...
}

zlog

HTTP Client

// 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)

}

More features

Please read the documentation https://docs.73zls.com/zls-go/#

Todo

  • HttpServer
  • HttpClient
  • JSON RPC
  • Logger
  • Json processing
  • String processing
  • Validator
  • Hot Restart
  • Daemon
  • Abnormal report
  • Terminal application
  • Goroutine pool
  • HTML Parse
  • Injection
  • Server Sent Event
  • High-performance HashMap
  • Database
  • ...(Read more documentation)

LICENSE

MIT

# Packages

Package zarray provides array operations.
Package zcache cache operation.
Package zcli quickly build cli applications.
Package zdi provides dependency injection.
Package zerror provides error related operations.
Package zfile file and path operations in daily development.
Package zhttp provides http client related operations.
Package zjson json data read and write operations.
Package zlog provide daily log service.
Package znet provides web service package main import ( "github.com/sohaha/zlsgo/znet" ) func main(){ r := znet.New() r.SetMode(znet.DebugMode) r.GET("/", func(c znet.Context) { c.String(200, "hello world") }) znet.Run() } */.
No description provided by the author
Package zpprof provides a register for zweb framework to use net/http/pprof easily.
Package zreflect provides reflection tools package main import ( "github.com/sohaha/zlsgo/zreflect" ) type Demo struct { Name string } func main() { typ := zreflect.TypeOf(Demo{}) println(typ.NumMethod()) } */.
Package zshell use a simple way to execute shell commands.
Package zstring provides String related operations.
No description provided by the author
Package ztime provides time related operations.
Package ztype provides Variable Type Related Operations.
Package zutil daily development helper functions.
Package zvalid data verification.

# Functions

NewTest testing object.

# Structs

TestUtil Test aid.