# README
file
LoadFile 加载ini,json,yaml文件
func LoadFile(config interface{}, file string, fileType int) (err error)
package main
import (
"github.com/lailailee/toolbox/file"
)
type Config struct {
Owner struct {
Name string `ini:"name"`
Organization string `ini:"organization"`
} `ini:"owner"`
Database struct {
Server string `ini:"server"`
Port int `ini:"port"`
Type string `ini:"type"`
Username string `ini:"username"`
Password string `ini:"password"`
} `ini:"database"`
}
var config Config
file.LoadFile(&config, "config.ini", file.Ini)
file.LoadFile(&config, "config.json", file.Json)
file.LoadFile(&config, "config.yaml", file.Yaml)
# Packages
No description provided by the author
# Functions
No description provided by the author
CheckTcpPort 检查端口是否开放.
Md5 将字符串转为md5.
GenerateRandomNumber 生成count个[start,end)结束的不重复的随机数.
InitEnvirment 初始化环境.
debugLevel : debug info error warn fatal InitLogger init logger.
IsDev 判断当前是否是开发环境 true 开发环境.
LoadFile 按类型读取文件.
NewLocalClient create local client.
ParseImageToBase64 是通过读取图片,并把图片转为base64格式,方便通过json传输.
No description provided by the author
SaveBase64ToImage 将base64图片保存到指定路径.
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
# Structs
LClient 的配置.
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author