zlsgo

package module
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 6 Imported by: 0

README

English | 简体中文

Build Status Go Report Card GoDoc flat codecov

文档

查看文档

建议搭配 zzzzzz watch 指令使用

特性

  • 简单易用、足够轻量

快速上手

安装

$ 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()
}

日志工具

package main 

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

func main(){
    zlog.Debug("这是一个测试")
    zlog.Error("这是一个错误")
    // zlog...
}

更多功能

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

Todo

  • HttpServer
  • HttpClient
  • Logger
  • Json processing
  • String processing
  • Validator
  • ...

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 数组操作
Package zarray 数组操作
Package zhttp provides http client related operations
Package zhttp provides http client related operations
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 zstring provides String related operations
Package zstring provides String related operations
Package ztime provides time related operations
Package ztime provides time related operations
Package ztype provides Variable Type Related Operations
Package ztype provides Variable Type Related Operations

Jump to

Keyboard shortcuts

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