Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayToString(array []string) string
- func BigCamelName(s string) string
- func CalcFileMD5(file io.Reader) (string, error)
- func CheckSN(snStr string) error
- func ConvertBD09ToGCJ02(lat, lon float64) (float64, float64)
- func ConvertGCJ02ToBD09(lat, lon float64) (float64, float64)
- func Cors() gin.HandlerFunc
- func DateStringToUnix(str string) int64
- func ExtractFileNameAndType(str string) (string, string)
- func FormatDate(date time.Time) string
- func FormatSqlNullDate(t sql.NullTime) string
- func FormatSqlNullTime(t sql.NullTime) string
- func FormatTime(date time.Time) string
- func GenMac(mac int64) string
- func GenSN(sn int64) string
- func GenSN64(sn int64) string
- func GenShortID(prefix string) string
- func GenerateOrderString(str, defaultSort string) (string, error)
- func Get(url string, response interface{}, tlsConfig *tls.Config, ...) error
- func GetByWebService(url string, response interface{}, tlsConfig *tls.Config, ...) error
- func GetFileExtensionByLanguage(language string) string
- func GetHardDriveSerial() (string, error)
- func GetMotherboardSerial() (string, error)
- func JsonToStringArray(str string) []string
- func LcFirst(s string) string
- func LowerSnakeCase(s string) string
- func ObjectToJsonString(obj interface{}) string
- func ParseDate(str string) time.Time
- func ParseSqlNullDate(str string) sql.NullTime
- func ParseSqlNullTime(str string) sql.NullTime
- func ParseTime(str string) time.Time
- func ParseTime2(str string) time.Time
- func ParseTimeWithLayout(str, layout string) time.Time
- func Post(url string, body io.Reader, response interface{}, tlsConfig *tls.Config, ...) error
- func PostByWebService(url string, body io.Reader, response interface{}, tlsConfig *tls.Config, ...) error
- func RemoveLastCharS(s string) string
- func SetLogFileName(name string)
- func SetWriteLogFunc(w WriteLog)
- func StringToArray(str string) []string
- func TimeStringToUnix(str string) int64
- func ToTableName(str string) string
- func ToUpper(str string) string
- func UnixToDateString(n int64) string
- func UnixToTimeString(n int64) string
- func UpperSnakeCase(s string) string
- type CPUInfoProvider
- type IconFont
- type LinuxCPUInfoProvider
- type MacOSCPUInfoProvider
- type WindowsCPUInfoProvider
- type WriteLog
Constants ¶
const ( TimeLayout = "2006-01-02 15:04:05" DateLayout = "2006-01-02" )
Variables ¶
var NamingStrategy schema.NamingStrategy
Functions ¶
func BigCamelName ¶
BigCamelName 转大驼峰式命名 例如helloWorld -> HelloWorld
func ConvertBD09ToGCJ02 ¶
* * 坐标转换,百度地图坐标转换成腾讯地图坐标 * @param lat 百度坐标纬度 * @param lon 百度坐标经度 * @return 返回结果:纬度,经度
func ConvertGCJ02ToBD09 ¶
* * 坐标转换,腾讯地图转换成百度地图坐标 * @param lat 腾讯纬度 * @param lon 腾讯经度 * @return 返回结果:经度,纬度
func ExtractFileNameAndType ¶
ExtractFileNameAndType 提取文件名和文件类型
func FormatSqlNullDate ¶
FormatSqlNullDate sql.NullTime转日期字符串 格式2006-01-02
func FormatSqlNullTime ¶
FormatSqlNullTime sql.NullTime转时间字符串 格式2006-01-02 15:04:05
func FormatTime ¶
FormatTime time.Time转时间字符串 格式2006-01-02 15:04:05
func GenerateOrderString ¶
func GetByWebService ¶
func GetFileExtensionByLanguage ¶
GetFileExtensionByLanguage 根据编程语言获取文件后缀名
func GetMotherboardSerial ¶
GetMotherboardSerial 获取主板序列号
func JsonToStringArray ¶
JsonToStringArray json字符串转字符串数组
func ObjectToJsonString ¶
func ObjectToJsonString(obj interface{}) string
ObjectToJsonString 对象转json字符串
func ParseSqlNullDate ¶
ParseSqlNullDate 日期字符串转sql.NullTime
func ParseSqlNullTime ¶
ParseSqlNullTime 时间字符串转sql.NullTime
func ParseTimeWithLayout ¶
func PostByWebService ¶
func SetLogFileName ¶
func SetLogFileName(name string)
func SetWriteLogFunc ¶
func SetWriteLogFunc(w WriteLog)
func UnixToDateString ¶
UnixToDateString 时间戳转日期字符串 格式2006-01-02
func UnixToTimeString ¶
UnixToTimeString 时间戳转时间字符串 格式2006-01-02 15:04:05
Types ¶
type CPUInfoProvider ¶
func GetCPUInfoProvider ¶
func GetCPUInfoProvider() CPUInfoProvider
GetCPUInfoProvider 根据运行时环境返回相应平台的CPUInfoProvider实例
type IconFont ¶
func GenIconFont ¶
type LinuxCPUInfoProvider ¶
type LinuxCPUInfoProvider struct{}
LinuxCPUInfoProvider 用于获取Linux平台上的CPU信息
func (*LinuxCPUInfoProvider) GetSerialNumber ¶
func (l *LinuxCPUInfoProvider) GetSerialNumber() (string, error)
type MacOSCPUInfoProvider ¶
type MacOSCPUInfoProvider struct{}
MacOSCPUInfoProvider 用于获取macOS平台上的CPU信息
func (*MacOSCPUInfoProvider) GetSerialNumber ¶
func (m *MacOSCPUInfoProvider) GetSerialNumber() (string, error)
type WindowsCPUInfoProvider ¶
type WindowsCPUInfoProvider struct{}
WindowsCPUInfoProvider 用于获取Windows平台上的CPU信息
func (*WindowsCPUInfoProvider) GetSerialNumber ¶
func (w *WindowsCPUInfoProvider) GetSerialNumber() (string, error)