Categorygithub.com/Khellendros97/srun_utils
modulepackage
0.0.8
Repository: https://github.com/khellendros97/srun_utils.git
Documentation: pkg.go.dev

# README

srun_utils

公司项目实用工具汇总

导入

import "github.com/Khellendros97/srun_utils"

# Packages

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

# Functions

获取秘钥.
导出文件到csv中.
根据流量值和单位转换成相应的kb.
@title 111111~~999999六位随机数 @author zhanglianfeng 2021/8/24.
有开始时间和结束时间时,比较开始时间是否大于结束时间,大于,则提示开始查询时间不能大于结束时间 否则,比较开始时间和结束时间的月份是否相同,若不同,则提示开始查询时间和结束时间不在同一个月 否则,若有开始时间没有结束时间,则结束时间等于开始时间+1天 若有结束时间没有开始时间,则直接返回 若既没有开始时间也没有结束时间,结束时间为当前时间.
获取表名.
No description provided by the author
@title IsDir @description 判断所给路径是否为文件夹 @author DM @time 2021/4/9 13:50 @param path @return bool.
@title IsExist @description checks whether a file or directory exists @author DM @time 2021/4/9 13:36 @param f @return bool It returns false when the file or directory does not exist.
@title IsFile @description checks whether the path is a file @author DM @time 2021/4/9 13:37 @param f @return bool it returns false when it's a directory or does not exist.
ListFiles 列出目录下所有文件(非递归).
* MapGet create a function that could get value from a map, if key not exists, return the default value * Usage: * m := map[string]interface{} { * "key1": "value1", * "key2": 2, * } * getOrElse := MapGet(m) // make a "getOrElse" function * val1 := getOrElse("key1", "default value").(string) // val1 == "value1" * val2 := getOrElse("key2", 0).(int) // val2 == 2 * val3 := getOrElse("key3(not exists)", "unknown") // no such key in the map, so val3 == "unknown" */.
No description provided by the author
No description provided by the author
@title 数字类型转字符串类型ip地址 @author zhanglianfeng 2021/7/20.
@title 字符串类型转数字类型ip地址 @author zhanglianfeng 2021/7/20.
@title 字符串类型转数字类型ip地址 @author zhanglianfeng 2021/7/20.
No description provided by the author
* 读取配置文件 */.
ReadListFile 读取列表文件.
@title SegmentByDate@description 将一个时间段分割到数组中@autor ZHANGYAN@time 2021/7/8 15:08.
将结构体转换为map.
将结构体转换为map.
No description provided by the author
根据时间和单位转换成秒.
@title TimeFromInt64 @description 时间戳 -> time.Time @auth 黄宇超 时间(2021/4/2).
@title TimeFromString @description string -> time.Time @auth 黄宇超 时间(2021/4/2).
@title TimeStampToTimeString @description 将时间戳转为可读的字符串 @auth 黄宇超 时间(2021/4/2).
@title TimeStringToInt@description 将时间戳转化为年月日 1625711519(2021-07-08 10:31:59) -> 1625673600(2021-07-08)@autor ZHANGYAN@time 2021/7/8 13:26.
@title TimeStringToTimeStamp @description 将字符串转化为时间戳 @auth 黄宇超 时间(2021/4/2).
@title TimeToString @description time.Time -> string, 格式为 YYYY-MM-DD hh:mm:ss @auth 黄宇超 时间(2021/4/2).
往csv文件中写数据.
@title 下载多工作表模板文件 @author zhanglianfeng 2021/7/16.