update
This commit is contained in:
10
util/file.go
10
util/file.go
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Description : 文件相关工具
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-04-26 6:00 下午
|
||||
package util
|
||||
@ -18,7 +18,7 @@ import (
|
||||
|
||||
// GetProjectPath 获取项目路径(可执行文件所在目录)
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:32 下午 2021/4/26
|
||||
func GetProjectPath() (string, error) {
|
||||
@ -37,7 +37,7 @@ func GetProjectPath() (string, error) {
|
||||
|
||||
// ReadYmlConfig 读取yml配置问价,并解析到指定的结构体中
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:35 下午 2021/4/26
|
||||
func ReadYmlConfig(filePath string, result interface{}) error {
|
||||
@ -56,7 +56,7 @@ func ReadYmlConfig(filePath string, result interface{}) error {
|
||||
|
||||
// ReadFileContent 读取文件内容
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:37 下午 2021/4/26
|
||||
func ReadFileContent(filePath string) ([]byte, error) {
|
||||
@ -78,7 +78,7 @@ func ReadFileContent(filePath string) ([]byte, error) {
|
||||
|
||||
// IsFileExist 判断文件是否存在
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:37 下午 2021/4/26
|
||||
func IsFileExist(filePath string) (bool, bool) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Description : util...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-02-24 11:04 下午
|
||||
package util
|
||||
@ -15,7 +15,7 @@ import (
|
||||
|
||||
// GetHashID ...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 11:04 下午 2021/2/24
|
||||
func GetHashID(key interface{}) uint64 {
|
||||
@ -24,7 +24,7 @@ func GetHashID(key interface{}) uint64 {
|
||||
|
||||
// GetHashIDMod 获取hashID并取模
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 11:07 下午 2021/2/24
|
||||
func GetHashIDMod(key interface{}, shard int) int {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Description : util...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-03-09 5:56 下午
|
||||
package util
|
||||
@ -11,7 +11,7 @@ import "net"
|
||||
|
||||
// GetHostIP 获取本机IP地址
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 5:58 下午 2021/3/9
|
||||
func GetHostIP() string {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Description : 字符串相关的工具
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-03-09 6:00 下午
|
||||
package util
|
||||
@ -16,7 +16,7 @@ import (
|
||||
|
||||
// GenRandomString 获取随机长度的字符串
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 6:01 下午 2021/3/9
|
||||
func GenRandomString(source string, length uint) string {
|
||||
@ -38,7 +38,7 @@ func GenRandomString(source string, length uint) string {
|
||||
|
||||
// Md5 对字符串进行md5加密
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 6:01 下午 2021/3/9
|
||||
func Md5(str string) string {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Description : util ...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-03-14 11:11 下午
|
||||
package util
|
||||
@ -11,7 +11,7 @@ import "encoding/json"
|
||||
|
||||
// StructToMap 结构体转为map
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 11:12 下午 2021/3/14
|
||||
func StructToMap(data interface{}) (map[string]interface{}, error) {
|
||||
|
Reference in New Issue
Block a user