zlsgo

package module
v0.1.58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 6 Imported by: 0

README

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

日志工具

package main

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

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

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

Documentation

Overview

Package zlsgo is golang daily development of some commonly used functions set

See http://docs.73zls.com/

znet(Web development) https://godoc.org/github.com/sohaha/zlsgo/znet

ztype(Type correlation) https://godoc.org/github.com/sohaha/zlsgo/ztype

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestUtil

type TestUtil struct {
	T *testing.T
}

TestUtil Test aid

func NewTest

func NewTest(t *testing.T) *TestUtil

NewTest testing object

func (*TestUtil) Equal

func (u *TestUtil) Equal(expected, actual interface{})

Equal Equal

func (*TestUtil) EqualExit added in v0.0.19

func (u *TestUtil) EqualExit(expected, actual interface{})

EqualExit EqualExit

func (*TestUtil) EqualNil added in v0.0.21

func (u *TestUtil) EqualNil(actual interface{})

EqualNil EqualNil

func (*TestUtil) EqualTrue added in v0.0.21

func (u *TestUtil) EqualTrue(actual interface{})

EqualTrue EqualTrue

func (*TestUtil) Fatal added in v0.0.19

func (u *TestUtil) Fatal(v ...interface{})

Fatal Fatal

func (*TestUtil) GetCallerInfo added in v0.0.19

func (u *TestUtil) GetCallerInfo() string

GetCallerInfo GetCallerInfo

func (*TestUtil) Log

func (u *TestUtil) Log(v ...interface{})

Log log

func (*TestUtil) PrintMyName

func (u *TestUtil) PrintMyName() string

PrintMyName PrintMyName

Directories

Path Synopsis
Package zarray provides array operations
Package zarray provides array operations
Package zcache cache operation
Package zcache cache operation
Package zcli quickly build cli applications
Package zcli quickly build cli applications
Package zfile file and path operations in daily development
Package zfile file and path operations in daily development
Package zhttp provides http client related operations
Package zhttp provides http client related operations
Package zjson json data read and write operations
Package zjson json data read and write operations
Package zlog provide daily log service
Package zlog provide daily log service
Package zweb 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() }
Package zweb 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() }
Package zpprof provides a register for zweb framework to use net/http/pprof easily.
Package zpprof provides a register for zweb framework to use net/http/pprof easily.
Package zshell use a simple way to execute shell commands
Package zshell use a simple way to execute shell commands
Package zstring provides String related operations
Package zstring provides String related operations
Package ztime provides time related operations
Package ztime provides time related operations
cron
Package cron emulate linux crontab
Package cron emulate linux crontab
Package ztype provides Variable Type Related Operations
Package ztype provides Variable Type Related Operations
Package zutil daily development helper functions
Package zutil daily development helper functions
daemon
Package daemon program is installed as a system service to achieve process daemon * @Author: seekwe * @Date: 2020-06-06 17:03:53 * @Last Modified by:: seekwe * @Last Modified time: 2020-06-09 16:39:23
Package daemon program is installed as a system service to achieve process daemon * @Author: seekwe * @Date: 2020-06-06 17:03:53 * @Last Modified by:: seekwe * @Last Modified time: 2020-06-09 16:39:23
Package zvalid data verification
Package zvalid data verification

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL