helper

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package helper 通用的帮助方法

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(path string, key []byte, iv [aes.BlockSize]byte) error

AesDecrypt 解密单个文件,解密前请确保文件有[aes_ofb]前缀

func AesDecryptRecursion

func AesDecryptRecursion(path string, key []byte, iv [aes.BlockSize]byte) error

AesDecryptRecursion 递归解密文件

func AesEncrypt

func AesEncrypt(path string, key []byte, iv [aes.BlockSize]byte) error

AesEncrypt 加密单个文件,加密后文件会多一个[aes_ofb]的前缀

func FileTime

func FileTime(info os.FileInfo) (string, string, string)

FileTime 获取文件的创建时间,最后访问时间,修改时间

func HttpGet

func HttpGet(client *http.Client, reqUrl string, reval any) error

HttpGet get请求资源,将reval对象传入进行序列化,然后返回

func HttpPostFile

func HttpPostFile(client *http.Client, path string, reqUrl string, reval any) error

HttpPostFile Post上传文件

func HttpPostForm

func HttpPostForm(client *http.Client, reqUrl string, reqValue url.Values, reval any) error

HttpPostForm post请求资源,将reval对象传入进行序列化,然后返回

func Int64SliceToStringSlice

func Int64SliceToStringSlice(val []int64) []string

func PathSeparatorFormat

func PathSeparatorFormat(s string) string

PathSeparatorFormat 将所有的\替换为/

func SplitFile

func SplitFile(path string) (md5s []string, tmps []string, clean func() error, err error)

SplitFile 按照指定大小分割文件 path:需要分割的文件路径 size:按照多大来进行分割【这里写死4MB分割】 return 分割后的文件的md5切片,分割后的文件路径,一个用来清理生成的临时目录回调函数,产生的错误

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL