github.com/sohaha/zlsgo@v1.7.13-0.20240501141223-10dd1a906f76/README.EN.md (about) 1 English | [简体中文](./README.md) 2 3 ![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/sohaha/zlsgo) 4 ![flat](https://img.shields.io/github/languages/top/sohaha/zlsgo.svg?style=flat) 5 [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/sohaha/zlsgo?tab=subdirectories) 6 [![UnitTest](https://github.com/sohaha/zlsgo/actions/workflows/go.yml/badge.svg)](https://github.com/sohaha/zlsgo/actions/workflows/go.yml) 7 [![Go Report Card](https://goreportcard.com/badge/github.com/sohaha/zlsgo)](https://goreportcard.com/report/github.com/sohaha/zlsgo) 8 [![codecov](https://codecov.io/gh/sohaha/zlsgo/branch/master/graph/badge.svg)](https://codecov.io/gh/sohaha/zlsgo) 9 10 ![luckything](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa4bcc6b2-32ef-4a7d-ba1c-65a0330f632d%2Flogo.png?table=block&id=37f366ec-0593-4a21-94c0-c24023a85354&width=590&cache=v2) 11 12 Golang daily development common function library 13 14 ## Documentation 15 16 [Check out the documentation](https://docs.73zls.com/zls-go/#) 17 18 Recommended to use with the `zzz watch` command of [zzz](https://github.com/sohaha/zzz) 19 20 ## Why Zara 21 22 Simple and easy to use, lightweight enough to avoid excessive external dependencies, 23 minimum compatible with old systems such as Window 7. 24 25 ## QuickStart 26 27 ### Install 28 29 ```bash 30 $ go get github.com/sohaha/zlsgo 31 ``` 32 33 ### HTTP Service 34 35 ```go 36 // main.go 37 package main 38 39 import ( 40 "github.com/sohaha/zlsgo/znet" 41 ) 42 43 func main(){ 44 r := znet.New() 45 46 r.GET("/hi", func(c *znet.Context) { 47 c.String(200, "Hello world") 48 }) 49 // Implicit routing (struct binding) please refer to the document 50 znet.Run() 51 } 52 ``` 53 54 ![znet](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F1d7f2372-5d58-4848-85ca-1bedf8ad14ae%2FUntitled.png?table=block&id=18fdfaa9-5dab-4cb8-abb3-f19ff37ed3f0&width=2210&userId=&cache=v2) 55 56 ### Logger 57 58 ```go 59 package main 60 61 import ( 62 "github.com/sohaha/zlsgo/zlog" 63 ) 64 65 func main(){ 66 zlog.Debug("This is a debug") 67 zlog.Error("This is a error") 68 // zlog... 69 } 70 ``` 71 72 ![zlog](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd8cc2527-8d9d-466c-b5c8-96e706ee0691%2FUntitled.png?table=block&id=474726aa-05fd-47ba-b270-59017c59817b&width=2560&cache=v2) 73 74 ### HTTP Client 75 76 ```go 77 // main.go 78 package main 79 80 import ( 81 "github.com/sohaha/zlsgo/zhttp" 82 "github.com/sohaha/zlsgo/zlog" 83 ) 84 85 func main(){ 86 data, err := zhttp.Get("https://github.com") 87 if err != nil { 88 zlog.Error(err) 89 return 90 } 91 res := data.String() 92 zlog.Debug(res) 93 94 } 95 ``` 96 97 ### More features 98 99 Please read the documentation [https://docs.73zls.com/zls-go/#](https://docs.73zls.com/zls-go/#) 100 101 ## Todo 102 103 - [x] HttpServer 104 - [x] HttpClient 105 - [x] JSON RPC 106 - [x] Logger 107 - [x] Json processing 108 - [x] String processing 109 - [x] Validator 110 - [x] Hot Restart 111 - [x] Daemon 112 - [x] Abnormal report 113 - [x] Terminal application 114 - [x] Goroutine pool 115 - [x] HTML Parse 116 - [x] Injection 117 - [x] Server Sent Event 118 - [x] High-performance HashMap 119 - [ ] [Database](https://github.com/sohaha/zdb) 120 - [ ] ...(Read more [documentation](https://docs.73zls.com/zls-go/#)) 121 122 ## LICENSE 123 124 [MIT](LICENSE)