Documentation ¶
Index ¶
- Variables
- type Audio
- func (obj *Audio) ConvertMggToMp3(umPath string, ffmpegPath string, mggPath string, oggPath string, ...)
- func (obj *Audio) ConvertMggToOgg(umPath string, mggPath string, oggPath string)
- func (obj *Audio) ConvertOggToMp3(ffmpegPath string, oggPath string, mp3Path string)
- func (obj *Audio) ConvertOggToMp3Async(ffmpegPath string, oggPath string, mp3Path string, maxG int)
- func (obj *Audio) DeleteFilenameBlank(root string)
- type DingTalk
- type Excel
- func (obj *Excel) ExcelToSQL(filename string, sheetname string, tablename string, fields []string, ...) ([]string, error)
- func (obj *Excel) SliceToExcelBuff(s [][]interface{}) (buf *bytes.Buffer)
- func (obj *Excel) SliceToExcelFile(s [][]interface{}, path string, filename string) (err error)
- func (obj *Excel) SliceToGinResp(s [][]interface{}, filename string, context *gin.Context)
- func (obj *Excel) StructSliceToGinResp(slice interface{}, filename string, context *gin.Context)
- func (obj *Excel) StructToSlice(slice interface{}, addFieldName bool) [][]interface{}
- type Http
- func (obj *Http) CreateFileServer(localPath string, relativePath string, port string, OnlyListenLocalAddr bool)
- func (obj *Http) CreateFileServerByGin(localPath string, relativePath string, port string, OnlyListenLocalAddr bool)
- func (obj *Http) CreateHttpProxyClient(proxy string, timeout int) *http.Client
- func (obj *Http) TestMulHttpProxy(proxys []string, timeout int, maxG int, printLog bool) (success []string, fail []string)
- func (obj *Http) TestOneHttpProxy(proxy string, timeout int) (string, error)
- type Mail
- type Nepal
- func (obj *Nepal) GetRandomNum(N, M int) (result int)
- func (obj *Nepal) GetRandomString(n int) (result string)
- func (obj *Nepal) GetRootPath() (root string)
- func (obj *Nepal) ReadFileToSlice(filepath string) (lines []string)
- func (obj *Nepal) StructToSlice(slice interface{}, addFieldName bool) [][]interface{}
- type Qiniu
- type SSHClient
Constants ¶
This section is empty.
Variables ¶
var DAudio = &Audio{}
var DExcel = &Excel{}
var DHttp = &Http{}
var DNepal = &Nepal{}
var DQiniu = &Qiniu{ AccessKey: "xxx", SecretKey: "xxx", Bucket: "images-mkd", Zone: &storage.ZoneHuanan, Domain: "http://image.youthsweet.com", }
Functions ¶
This section is empty.
Types ¶
type Audio ¶ added in v1.0.7
type Audio struct{}
func (*Audio) ConvertMggToMp3 ¶ added in v1.0.7
func (obj *Audio) ConvertMggToMp3(umPath string, ffmpegPath string, mggPath string, oggPath string, mp3Path string, maxG int)
ConvertMggToMp3 格式化文件名、解密、转换一步到位
func (*Audio) ConvertMggToOgg ¶ added in v1.0.7
ConvertMggToOgg 通过um将mgg格式解密为ogg格式
func (*Audio) ConvertOggToMp3 ¶ added in v1.0.7
ConvertOggToMp3 通过ffmpeg将ogg转换为mp3格式
func (*Audio) ConvertOggToMp3Async ¶ added in v1.0.7
ConvertOggToMp3Async 通过ffmpeg将ogg转换为mp3格式,并发模式
func (*Audio) DeleteFilenameBlank ¶ added in v1.0.7
DeleteFilenameBlank 遍历目录,删除文件名中的空格并重命名
type DingTalk ¶ added in v1.0.7
DingTalk https://open.dingtalk.com/document/robots/customize-robot-security-settings
func NewDingTalk ¶ added in v1.0.7
func (*DingTalk) SendMsgToDingDing ¶ added in v1.0.7
SendMsgToDingDing 钉钉机器人发送消息
type Excel ¶ added in v1.0.7
type Excel struct{}
func (*Excel) ExcelToSQL ¶ added in v1.0.7
func (obj *Excel) ExcelToSQL(filename string, sheetname string, tablename string, fields []string, is_column_mode bool) ([]string, error)
ExcelToSQL Excel转成SQL语句
func (*Excel) SliceToExcelBuff ¶ added in v1.0.7
SliceToExcelBuff 将切片转换为Excel格式,并返回bytes.Buffer,可以保存为文件或写入http响应体
func (*Excel) SliceToExcelFile ¶ added in v1.0.7
SliceToExcelFile 将切片写入Excel文件
func (*Excel) SliceToGinResp ¶ added in v1.0.7
SliceToGinResp 将切片写入Excel文件,写入http响应体,实现Excel文件下载
func (*Excel) StructSliceToGinResp ¶ added in v1.0.7
StructSliceToGinResp 将结构体切片写入Excel文件,写入http响应体,实现Excel文件下载
func (*Excel) StructToSlice ¶ added in v1.0.7
StructToSlice 将任意结构体切片转换为二维切片[][]interface{},addFieldName是否添加字段名
type Http ¶ added in v1.0.7
type Http struct{}
func (*Http) CreateFileServer ¶ added in v1.0.7
func (obj *Http) CreateFileServer(localPath string, relativePath string, port string, OnlyListenLocalAddr bool)
CreateFileServer 创建一个HTTP文件服务器,注意relativePath路径后要加斜杠 example:DNepal.CreateFileServer("C:\\lee\\project\\go\\auto", "/static/", "8888", true)
func (*Http) CreateFileServerByGin ¶ added in v1.0.7
func (obj *Http) CreateFileServerByGin(localPath string, relativePath string, port string, OnlyListenLocalAddr bool)
CreateFileServerByGin 创建一个HTTP文件服务器,通过gin框架
func (*Http) CreateHttpProxyClient ¶ added in v1.0.7
CreateHttpProxyClient 创建一个http代理客户端,代理类型由uri确定,支持http/https/socks5,默认为http http://fans007:fans888@45.76.169.156:39000
type Mail ¶
Mail Gmail https://www.codenong.com/cs105864356/ 1.开启两步验证 2.创建专用密码 3.选择customer类型 Gmail 国内网络可能会超时
type Nepal ¶ added in v1.0.7
type Nepal struct{}
func (*Nepal) GetRandomNum ¶ added in v1.0.7
GetRandomNum 获取N~M之间的随机整数,N<=M
func (*Nepal) GetRandomString ¶ added in v1.0.7
GetRandomString 获取偶数位随机字符串
func (*Nepal) GetRootPath ¶ added in v1.0.7
GetRootPath 获取项目根路径,请将函数复制到自己的项目中使用,不能直接调用!
func (*Nepal) ReadFileToSlice ¶ added in v1.0.7
ReadFileToSlice 将文件中的所有非空行读入切片
func (*Nepal) StructToSlice ¶ added in v1.0.7
StructToSlice 将任意结构体切片转换为二维切片[][]interface{}
type Qiniu ¶ added in v1.0.7
type Qiniu struct { AccessKey string // 秘钥对 SecretKey string Bucket string // 空间(桶) Zone *storage.Zone // 地域: Domain string }
func (*Qiniu) DeleteFile ¶ added in v1.0.7
DeleteFile 删除bucket中的文件
func (*Qiniu) GetOutsideChain ¶ added in v1.0.7
GetOutsideChain 根据前缀匹配获取外链
type SSHClient ¶ added in v1.0.7
type SSHClient struct { User string Pass string Key string // 私钥文件路径,公钥需写入服务器的authorized_keys Host string Port int Timeout int Session *ssh.Session Client *ssh.Client }
func (*SSHClient) CreateSession ¶ added in v1.0.7
CreateSession 创建ssh会话
func (*SSHClient) RunScriptFile ¶ added in v1.0.7
RunScriptFile 执行脚本文件