Coder Social home page Coder Social logo

pkg's Introduction

pkg

Go Version Go Report Card Release Date MIT License Stars

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

related:

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/[email protected]
  • 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: 大量时间方法扩展
    • 生成时间戳
  • container: 扩展数据类型
    • dict: 字典数据类型
      • StringDict: map[string]string 扩展, 支持生成 url encode string
      • Dict: map[string]interface{} 扩展
  • convert: 数据格式转换工具
    • string: string to int, int to string
    • struct: struct 转换成 map[string][]string
    • map: map[string][]string 转换成 map[string]string
  • crypto`: 加密/解密工具
    • signature: 通用签名机制: 生成/验证 - 支持 md5/sha256/sha512 + nonce + ts
    • password: 密码: 加密/验证 - 使用 bcrypt 算法
  • com: 第三方企业 API SDK 接入
    • jpush: 极光推送
    • sendcloud: 搜狐短信服务
  • cronjob: 集成 cron job 库, 开箱即用,
  • x: 扩展一些框架

wiki:

development:

  • setup:
# required tool:
brew install go-task/tap/go-task

# this project root folder:
cd pkg/

# init:
task init

# get go pkg:
task tidy

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:

pkg's People

Contributors

hhstore avatar huangyangcong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.