Skip to content

825512123/common-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

common-go

公共库 基于gin框架内置了一些常用方法 如: 1.mysql数据库链接初始化,数据表转结构体 2.redis链接初始化,数据写入缓存,读取缓存,删除缓存,给key自增缓存,hash缓存等 3.公共方法: json返回,日志记录,根据指定格式返回日期,模拟php mb_substr字符串截取函数, map排序,结构体转map,结构体转json,map与json互转,模拟php in_array 元素是否在数组中, interface转int,sha1函数,Sha256函数,md5函数,获取随机字符串,获取随机数,post请求, 创建目录,创建文件并写入内容,判断文件夹文件是否存在等