Documentation ¶
Overview ¶
数组操作类 create by gloomy 2017-08-31 00:10:08
* 异步线程处理类 创建人:邵炜 创建时间:2017年3月13日14:34:27
* 时间处理类 创建人:邵炜 创建时间:2017年03月21日20:53:46
* AES加解密类库 create by gloomy 2017-03-29 23:32:31
email 类库 create by gloomy 2017-04-12 11:16:21
excel操作类 create by gloomy 2017-4-18 09:14:26
文件数据记录类 create by gloomy 2017-04-06 10:11:35
文件下载类 create by gloomy 2017-08-28 13:12:12
* 公共组件库 文件处理 创建人:邵炜 创建时间:2017年2月8日18:11:29
文件HTTP传输方法
FTP工具类 create by gloomy 2017-4-1 17:32:06
gin公共类 create by gloomy 2017-09-01 01:11:28
* gp数据库连接 create by gloomy 2017-3-30 15:24:11
* 随机数处理 create by gloomy 2017-03-29 22:11:23
* mySql数据库组件类 创建人:邵炜 创建时间:2017年03月11日15:55:14
* redis帮助类 create by gloomysw 2017-3-24 14:11:284
* 程序运行pid目录处理类 创建人:邵炜 创建时间:2017年03月11日11:03:55
sftp帮助类 create by gloomy 2017-05-09 20:19:24
增加map转换XML
* 公共组件库 构建三元运算 创建人:邵炜 创建时间:2017年2月8日18:50:51
文件监控类 create by gloomy 2017-5-3 11:40:32
压缩包解压 create by gloomy 2017-08-27 14:18:42
Index ¶
- Constants
- Variables
- func AesDecrypt(crypted string, aESKEY []byte) (string, error)
- func AesEncrypt(origData string, aESKEY []byte) (string, error)
- func AppendFileOpen(fileName string) (*os.File, error)
- func CheckPid(pidFileStr string) bool
- func CloseRedis()
- func CreateFileProcess(path string) error
- func DateFormat(timeDate time.Time, layerout string) string
- func ExcelSave(saveContent *map[string][][]string, saveFilePath string) error
- func ExecCommand(commandContent string) (*[]string, error)
- func FileCreateAndWrite(content *[]byte, fileName string, isAppend bool) error
- func FileOpen(fileName string) (*os.File, error)
- func FileTransferProtocol()
- func FtpExit(ftpConntion *ftp.ServerConn)
- func FtpFileStor(model *FtpHelpStruct, ftpConntion *ftp.ServerConn, contentByte *[]byte, ...) error
- func FtpNameList(pathStr string, ftpConntion *ftp.ServerConn, model *FtpHelpStruct) ([]string, error)
- func FtpRemoveFile(filePathStr string, ftpConntion *ftp.ServerConn, model *FtpHelpStruct) error
- func FtpRenameFile(from, to string, ftpConntion *ftp.ServerConn, model *FtpHelpStruct) error
- func GPSelectUnknowColumn(dbs *sql.DB, model GpDBStruct, sqlStr string, param ...interface{}) (*[]string, *[][]string, error)
- func GetMyAllDirByDir(pathStr string) (*[]string, error)
- func GetMyAllFileByDir(pathStr string) (*[]string, error)
- func GetMyFileName(filePaths string) *[]string
- func GetRedisCache(key string) (string, error)
- func GpSqlClose(db *sql.DB)
- func GpSqlConntion(model GpDBStruct) (*sql.DB, error)
- func GpSqlExec(dbs *sql.DB, model GpDBStruct, sqlStr string, param ...interface{}) (sql.Result, error)
- func GpSqlSelect(dbs *sql.DB, model GpDBStruct, sqlStr string, param ...interface{}) (*sql.Rows, error)
- func HttpGetDownFile(urlPathStr, saveFilePath string) error
- func HttpSendFile(sendHttpUrl, filePathStr, uploadFile string) error
- func If(condition bool, trueVal, falseVal interface{}) interface{}
- func LogInit(debug bool, logsDir string)
- func MustCompileMatch(matchStr, str string) bool
- func MySqlClose(dbs *sql.DB)
- func MySqlSQlConntion(model MySqlDBStruct) (*sql.DB, error)
- func MySqlSelect(dbs *sql.DB, model MySqlDBStruct, sqlStr string, param ...interface{}) (*sql.Rows, error)
- func MySqlSqlExec(dbs *sql.DB, model MySqlDBStruct, sqlStr string, param ...interface{}) (sql.Result, error)
- func MysqlSelectMap(dbs *sql.DB, model MySqlDBStruct, sqlStr string, param ...interface{}) (*[]map[string]string, error)
- func MysqlSelectUnknowColumn(dbs *sql.DB, model MySqlDBStruct, sqlStr string, param ...interface{}) (*[]string, *[][]string, error)
- func OpenRedis(addr string, idx int) error
- func PathExists(path string) (bool, error)
- func PictureBase64ToFile(fileContentTem *string, filePath string) (string, error)
- func RWFileByWhere(fileName string, fileWrite *os.File, ...) error
- func ReadExcel(excelFilePath string) (*map[string][][]string, error)
- func ReadFileByLine(filePath string) (*[]string, error)
- func ReadFileLineNumber(filePathStr string) (int, error)
- func RmPidFile(pidFileStr string)
- func Rounding(f float64, n int) float64
- func RoundingByInt(number, subNumber, n int) float64
- func RoundingPercentageByInt(number, subNumber, n int) float64
- func SendEmail(account, passWord, smtpUrl, smtpUrlPort, emailTitle string, ...) error
- func SetCPUUseNumber(number int)
- func SetRedisCache(key, value string, cacheBssSeconds int) error
- func SftpClose(sftpClient *sftp.Client, sshClient *ssh.Client) error
- func SftpReadDir(sftpModel SftpConfigStruct, sftpClient *sftp.Client, sshClient *ssh.Client, ...) (*[]os.FileInfo, error)
- func UnGzip(zipPathStr, filePathStr string) error
- func UniqueSlice(slice *[]string)
- func WatchFile(filePathStr, matchFileName string, ...) (*fsnotify.Watcher, error)
- func WatchFileAutoMated(filePath string, callBack func(string))
- func WritePid(pidFileStr string)
- func XmlContentReplace(value string) string
- type FileDataRecording
- func (f *FileDataRecording) Close()
- func (f *FileDataRecording) CreateNewFile() (err error)
- func (f *FileDataRecording) Exit()
- func (f *FileDataRecording) FileList() *[]string
- func (f *FileDataRecording) RemoveOldFileList(days int)
- func (f *FileDataRecording) Rotate()
- func (f *FileDataRecording) WriteData(dataStr string) (err error)
- type FtpHelpStruct
- type GpDBStruct
- type LoadFile
- type MySqlDBStruct
- type RequestData
- type SftpConfigStruct
Constants ¶
const ( WithNanos = "2006-01-02 15:04:05" // 时间格式化字符串 Result_Success_Code = "00000" // 接口返回成功 )
const ProgramServicePIDPath = "./programRunPID.pid" // PID文件生成路径
Variables ¶
Functions ¶
func AesDecrypt ¶
* 字符串解密 创建人:邵炜 创建时间:2016年3月18日09:56:20 输入参数: 需要解密的字符串 解密后字符串长度 输出参数: 解密后字符串 错误对象
func AesEncrypt ¶
* 字符串加密 创建人:邵炜 创建时间:2016年3月18日09:50:36 输入参数: 需要加密的字符串 输出参数: 加密后字符串 错误对象
func AppendFileOpen ¶
* 文件打开 创建人:邵炜 创建时间:2017年3月14日14:54:08 输入参数:文件路径 输出参数:文件对象 错误对象
func CheckPid ¶
* 检查pid文件是否存在,pid文件中的进程是否存在 创建人:邵炜 创建时间:2017年03月11日15:36:21 输入参数:pid文件路径 输出参数:bool类型(true: 文件不存在或者进程不存在 false: 进程已存在)
func CreateFileProcess ¶
* 根据文件夹路径创建文件,如文件存在则不做任何操作 创建人:邵炜 创建时间:2016年12月21日17:23:54 输入参数:文件夹路径 输出参数:错误对象
func DateFormat ¶
* 时间格式化处理 创建人:邵炜 创建时间:2017年3月22日09:13:01 输入参数:需要格式化的时间 格式化方式 示例yyyy-MM-dd hh:mm:ss.tttttt 2017-03-22 10:21:55.379415
func ExecCommand ¶
执行函数命令 commandContent 需要执行的命令 create by gloomy 2018-2-25 16:41:52
func FileCreateAndWrite ¶
* 写文件 创建人:邵炜 创建时间:2016年9月7日16:31:39 输入参数:文件内容 写入文件的路劲(包含文件名) 是否追加写入 输出参数:错误对象
func FtpFileStor ¶
func FtpFileStor(model *FtpHelpStruct, ftpConntion *ftp.ServerConn, contentByte *[]byte, createFilePath string) error
FTP文件传输 create by gloomy 2017-4-1 17:36:11 FTP配置实体 文件内容 创建目标服务器的文件名 错误对象
func FtpNameList ¶
func FtpNameList(pathStr string, ftpConntion *ftp.ServerConn, model *FtpHelpStruct) ([]string, error)
获取FTP上所有的文件列表 create by gloomy 2017-04-12 10:43:25 目录地址 文件列表集 错误对象
func FtpRemoveFile ¶
func FtpRemoveFile(filePathStr string, ftpConntion *ftp.ServerConn, model *FtpHelpStruct) error
FTP文件删除 create by gloomy 2017-04-02 01:08:15 文件名 ftp配置对象 错误对象
func FtpRenameFile ¶
func FtpRenameFile(from, to string, ftpConntion *ftp.ServerConn, model *FtpHelpStruct) error
ftp修正远程服务器文件名称 create by gloomy 2017-04-04 21:26:48 源文件 修正后的文件名称 ftp配置对象 错误对象
func GPSelectUnknowColumn ¶
func GPSelectUnknowColumn(dbs *sql.DB, model GpDBStruct, sqlStr string, param ...interface{}) (*[]string, *[][]string, error)
查询所有字段值 create by gloomy 2017-5-12 16:38:58
func GetMyAllDirByDir ¶
根据文件夹路径获取文件夹下所有文件夹 create by gloomy 2018-2-25 16:08:50
func GetMyAllFileByDir ¶
根据文件夹路径获取文件夹下所有文件 create by gloomy 2017-08-27 14:12:49
func GetMyFileName ¶
* 获取文件名称及后缀名 未防止文件无后缀名,固这里返回值为数组对象 创建人:邵炜 创建时间:2016年9月7日16:40:14 输入参数: 文件路劲或文件名称 输出参数: 文件名 文件后缀名 数组 第一项为文件名称 第二项为文件后缀名
func GetRedisCache ¶
获取redis缓存 create by gloomysw 2017-3-24 14:29:16 key 存储键名
func GpSqlConntion ¶
func GpSqlConntion(model GpDBStruct) (*sql.DB, error)
GP数据库连接 create by gloomy 2017-3-30 15:29:12
func GpSqlExec ¶
func GpSqlExec(dbs *sql.DB, model GpDBStruct, sqlStr string, param ...interface{}) (sql.Result, error)
* 数据库运行方法 创建人:邵炜 创建时间:2015年12月29日17:33:06 修正时间:2017年03月11日16:21:36 输入参数: dbs数据库连接对象 model数据库对象 sqlStr 要执行的sql语句 param执行SQL的语句参数化传递 输出参数: 执行结果对象 错误对象输出
func GpSqlSelect ¶
func GpSqlSelect(dbs *sql.DB, model GpDBStruct, sqlStr string, param ...interface{}) (*sql.Rows, error)
查询方法 create by gloomy 2017-3-30 16:04:53 dbs数据库连接对象 model数据库对象 sqlStr 要执行的sql语句 param执行SQL的语句参数化传递 查询返回条数 错误对象输出
func HttpGetDownFile ¶
get文件下载 create by gloomy 2017-08-28 15:33:17
func HttpSendFile ¶
* 文件发送处理方法 创建人:邵炜 创建时间:2016年11月29日15:37:06 输入参数:文件路径 输出参数:错误对象00001
func If ¶
func If(condition bool, trueVal, falseVal interface{}) interface{}
* 构建三元运算 创建人:邵炜 创建时间:2017年2月8日18:51:36 输入参数:是否匹配 第一返回数 第二返回数
func MustCompileMatch ¶
匹配规则是否存在 create by gloomy 2017-09-07 21:13:30
func MySqlSQlConntion ¶
func MySqlSQlConntion(model MySqlDBStruct) (*sql.DB, error)
* 数据库连接 创建人:邵炜 创建时间:2017年03月11日15:56:06 输入参数:数据库对象 输出对象:数据库连接对象
func MySqlSelect ¶
func MySqlSelect(dbs *sql.DB, model MySqlDBStruct, sqlStr string, param ...interface{}) (*sql.Rows, error)
* 查询方法 创建人:邵炜 创建时间:2015年12月29日17:26:41 修正时间:2017年03月11日16:21:45 输入参数: dbs数据库连接对象 model数据库对象 sqlStr 要执行的sql语句 param执行SQL的语句参数化传递 输出参数: 查询返回条数 错误对象输出
func MySqlSqlExec ¶
func MySqlSqlExec(dbs *sql.DB, model MySqlDBStruct, sqlStr string, param ...interface{}) (sql.Result, error)
* 数据库运行方法 创建人:邵炜 创建时间:2015年12月29日17:33:06 修正时间:2017年03月11日16:21:36 输入参数: dbs数据库连接对象 model数据库对象 sqlStr 要执行的sql语句 param执行SQL的语句参数化传递 输出参数: 执行结果对象 错误对象输出
func MysqlSelectMap ¶
func MysqlSelectMap(dbs *sql.DB, model MySqlDBStruct, sqlStr string, param ...interface{}) (*[]map[string]string, error)
查询返回map create by gloomy 2018-01-16 17:52:15
func MysqlSelectUnknowColumn ¶
func MysqlSelectUnknowColumn(dbs *sql.DB, model MySqlDBStruct, sqlStr string, param ...interface{}) (*[]string, *[][]string, error)
查询所有字段值 create by gloomy 2017-5-12 16:38:58
func PathExists ¶
* 判断文件或文件夹是否存在 创建人:邵炜 创建时间:2016年12月21日17:07:42 输入参数:需要查询的文件或文件夹路径 输出参数:返回值true存在 否则不存在 错误对象
func PictureBase64ToFile ¶
* base64图片转图片文件 创建人:邵炜 创建时间:2016年12月26日17:12:22 输入参数:图片base内容 图片文件存放路径(不包含图片名称) 输出参数:图片名称 错误对象
func RWFileByWhere ¶
func RWFileByWhere(fileName string, fileWrite *os.File, where func(content string, fileWrite *os.File)) error
* 根据条件读文件 创建人:邵炜 创建时间:2017年3月22日11:03:31 输入参数:文件路径 文件写入对象 条件平判断方法 输出参数:错误对象
func ReadFileByLine ¶
* 文件读取逐行进行读取 创建人:邵炜 创建时间:2016年9月20日10:23:41 输入参数: 文件路劲 输出参数: 字符串数组(数组每一项对应文件的每一行) 错误对象
func ReadFileLineNumber ¶
读取文件行数 create by gloomy 2017-6-2 14:00:32
func RmPidFile ¶
func RmPidFile(pidFileStr string)
* 删除PID文件 创建人:邵炜 创建时间:2017年03月11日15:35:20 输入参数:pid文件路径
func RoundingByInt ¶
* 四舍五入取舍 create by gloomy 2017-03-29 22:18:46 除数 被除数 取舍几位
func RoundingPercentageByInt ¶
* 四舍五入取舍 百分比 create by gloomy 2017-03-29 22:18:46 除数 被除数 取舍几位
func SendEmail ¶
func SendEmail(account, passWord, smtpUrl, smtpUrlPort, emailTitle string, emailContent *[]byte, toEmailUser []string, contentType string) error
发送邮件 create by gloomy 2017-04-12 11:18:23
func SetCPUUseNumber ¶
func SetCPUUseNumber(number int)
* 设置CPU核心使用数 创建人:邵炜 创建时间:2021-03-18 11:13:25
func SetRedisCache ¶
设置redis缓存 create by gloomysw 2017-3-24 14:24:31 key 存储键名 value 存储值 cacheBssSeconds 存储时间(单位秒)
func SftpReadDir ¶
func SftpReadDir(sftpModel SftpConfigStruct, sftpClient *sftp.Client, sshClient *ssh.Client, pathStr string) (*[]os.FileInfo, error)
sftp读取文件夹内容 create by gloomy 2017-05-10 11:50:14
func WatchFile ¶
func WatchFile(filePathStr, matchFileName string, deleteFileCallBack, modifyFileCallBack, renameFileCallBack, createFileCallBack func(string)) (*fsnotify.Watcher, error)
文件监控 create by gloomy 2017-5-3 11:42:09
func WatchFileAutoMated ¶
自动化创建任务 需要监控的文件,判断文件是否上传完毕 创建人:邵炜 创建时间:2016年9月5日14:58:13 输入参数: 文件路劲
func XmlContentReplace ¶
生成xml文件修正xml节点内容 create by gloomysw 2017-5-25 16:18:11
Types ¶
type FileDataRecording ¶
type FileDataRecording struct { sync.Mutex // 锁 F *os.File // 文件对象 FilePre string // 文件开头字符串 Fn string // 文件路径 Bytes int // 文件大小 Seq int // 第几个 FileProgram string // 文件存放路径 MaxFileDataRecordingBytes int // 文件大小 }
文件数据记录对象 create by gloomy 2017-04-06 10:15:00
func OpenLoadFile ¶
func OpenLoadFile(fileProgram, filePre string, maxSize int) *FileDataRecording
打开文件数据记录 create by gloomy 2017-04-06 10:17:38 文件存放目录地址 文件开头字符串 文件大小 文件数据对象
func (*FileDataRecording) Close ¶
func (f *FileDataRecording) Close()
文件关闭 create by gloomy 2017-04-06 10:22:14
func (*FileDataRecording) CreateNewFile ¶
func (f *FileDataRecording) CreateNewFile() (err error)
创建新文件 create by gloomy 2017-04-06 10:33:11 错误对象
func (*FileDataRecording) Exit ¶
func (f *FileDataRecording) Exit()
文件退出 create by gloomy 2017-04-06 10:27:58
func (*FileDataRecording) FileList ¶
func (f *FileDataRecording) FileList() *[]string
获取所有完成的文件列表 create by gloomy 2017-04-06 13:46:51 文件列表
func (*FileDataRecording) RemoveOldFileList ¶
func (f *FileDataRecording) RemoveOldFileList(days int)
删除过期文件 create by gloomy 2017-04-06 22:53:17 几天前
func (*FileDataRecording) Rotate ¶
func (f *FileDataRecording) Rotate()
文件切换 create by gloomy 2017-04-06 10:30:05
func (*FileDataRecording) WriteData ¶
func (f *FileDataRecording) WriteData(dataStr string) (err error)
写入数据 create by gloomy 2017-04-06 11:40:55 需要写入的数据 错误对象
type FtpHelpStruct ¶
type FtpHelpStruct struct { IpAddr string // ip 地址 Port int // 端口 TimeOut time.Duration // 超时时间 UserName string // 用户名 PassWord string // 密码 FilePaths string // 目标服务器路径 }
FTP帮助类实体 create by gloomy 2017-4-1 17:34:16
type GpDBStruct ¶
type GpDBStruct struct { DbUser string //数据库用户名 DbHost string //数据库地址 DbPort int //数据库端口 DbPass string //数据库密码 DbName string //数据库库名 MaxOpenConns int // 用于设置最大打开的连接数,默认值为0表示不限制 MaxIdleConns int // 用于设置闲置的连接数 }
GP数据库连接对象 create by gloomy 2017-3-30 15:27:26
type LoadFile ¶
StringMap is a map[string]string.
func (LoadFile) MarshalXML ¶
StringMap marshals into XML.
type MySqlDBStruct ¶
type MySqlDBStruct struct { DbUser string //数据库用户名 DbHost string //数据库地址 DbPort int //数据库端口 DbPass string //数据库密码 DbName string //数据库库名 MaxOpenConns int // 用于设置最大打开的连接数,默认值为0表示不限制 MaxIdleConns int // 用于设置闲置的连接数 }
* 数据库连接对象 创建人:邵炜 创建时间:2017年03月11日16:01:20
type RequestData ¶
接口返回对象 create by gloomy 2017-5-10 18:06:44
Source Files ¶
- arrayUtil.go
- asyncThreadProcess.go
- cmdUtil.go
- const.go
- cpuUtil.go
- dateProcess.go
- decryptionProcess.go
- emailUtil.go
- excelUtil.go
- fileDataRecording.go
- fileDownLoad.go
- fileProcess.go
- fileSendUtil.go
- ftpHelpProcess.go
- ginUtil.go
- gpDB.go
- logUtil.go
- mathProcess.go
- mysqlDB.go
- pictureUtil.go
- redisHelp.go
- servicePIDProcess.go
- sftpUtil.go
- stringMapStringMarshalXml.go
- structUtil.go
- ternaryOperation.go
- watchFileUtil.go
- xmlHelpUtil.go
- zipUtil.go
Directories ¶
Path | Synopsis |
---|---|
Package captcha implements generation and verification of image and audio CAPTCHAs.
|
Package captcha implements generation and verification of image and audio CAPTCHAs. |
capexample
example of HTTP server that uses the captcha package.
|
example of HTTP server that uses the captcha package. |
capgen
capgen is an utility to test captcha generation.
|
capgen is an utility to test captcha generation. |
capgensounds
generate is a tool to generate sounds.go from WAVE files.
|
generate is a tool to generate sounds.go from WAVE files. |