pkg

package module
v0.1.3 Latest Latest
Warning

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

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

README

pkg

golang pkg, common utils

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.1

  • usage:

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

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

features:

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

wiki:

requirements:

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