pkg

package module
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 0 Imported by: 0

README

pkg

Go Version Go Report Card Release Date MIT License Stars

  • golang pkg, common utils
  • 集成各种常用 lib, 开箱即用

quickstart:

  • install:

# use latest version:
go get -u -v github.com/better-go/pkg

# use specific tag:
go get -u -v github.com/better-go/pkg@v0.1.10

  • usage:

import (
	"github.com/better-go/pkg/random"
)

func Example() {
	// snowflake id:
	userID := random.SnowFlakeID()
	fmt.Printf("userID:%v\n", userID)
}

features:

  • log: log/log.go 集成 uber.log, 开箱即用.
  • sync/async: go func() 优雅异步.
  • retry: 通用重试wrap: 支持 backoff
  • orm 集成: gorm 扩展
    • mysql 支持
    • 集成 gorm v1, v2 版本
  • cache: 集成 redis
  • mq:
  • net:
  • config:
    • toml 格式配置文件读取
  • random:
    • uuid: ID 生成器
    • snowflake: twitter 雪花算法: 18位纯数字(有序+递增+唯一)
  • text:
    • xss: 预防 xss 校验
  • time: 大量时间方法扩展
    • 生成时间戳
  • crypto: 密码加密/验证
    • sign: 签名机制: 生成签名/验证签名
  • com: 第三方企业 API SDK 接入
    • jpush: 极光推送
    • sendcloud: 搜狐短信服务
  • cronjob: 集成 cron job 库, 开箱即用,
  • x: 扩展一些框架

wiki:

reference:


go get golang.org/x/text
go get golang.org/x/oauth2
go get golang.org/x/net
go get golang.org/x/crypto

research:

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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