utils

package
v0.0.0-...-d1f39bd Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 6 Imported by: 4

README

utils

获取方式

go get github.com/hzwy23/utils

简介

这是一个自己收集的常用工具包, 目前在asofdate项目中使用.

utils中模块简介:

  1. 配置文件读物模块
  2. http.Response返回处理
  3. i18n国际化处理
  4. log日志处理,基于go-uber封装制作
  5. jwt功能
  6. 日期处理功能
  7. hauth项目中联合主键操作
  8. 加密操作

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AGTB

func AGTB(A string, B string) bool

func AGTEB

func AGTEB(A string, B string) bool

func AddDays

func AddDays(start string, num int) (string, error)

func AddMonths

func AddMonths(start string, num int) (string, error)

func CheckSplit

func CheckSplit(str string) bool

判断编码是否由 domain id与code number 拼接而成.

func CompareDate

func CompareDate(start string, end string) int

第二个参数大于第一个参数时,返回 1 第二个参数小于第一个参数时,返回 -1 第一个参数等于第二个参数时,返回 0

func DataInterval

func DataInterval(start string, end string) int

func DateFormat

func DateFormat(str string, model string) (string, error)

将字符串类型的时间转换成日期

func FormatIntTodate

func FormatIntTodate(year int, month int, day int) (string, error)

将字符串格式化未yyyy-mm-dd形式

func FormatStringToDate

func FormatStringToDate(date string) (string, error)

func FormatToDate

func FormatToDate(str string) (string, error)

func FormatToTime

func FormatToTime(str string) (string, error)

func JoinCode

func JoinCode(domain_id, code_number string) string

func MonthInterval

func MonthInterval(start string, pmt_freq int) (int, error)

func SplitCode

func SplitCode(id string) (string, error)

返回编码信息的Code number

func SplitDomain

func SplitDomain(id string) (string, error)

返回编码信息的domain id

func ValidDate

func ValidDate(date string) bool

日期校验

Types

This section is empty.

Directories

Path Synopsis
Package config implements configuration file read
Package config implements configuration file read
crypto

Jump to

Keyboard shortcuts

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