Documentation
¶
Index ¶
- Constants
- Variables
- func AesEcbDecrypt(plainText, secretKey []byte) (cipherText []byte, err error)
- func AesEcbDecryptByBase64(cipherTextBase64 string, key []byte) (plainText []byte, err error)
- func AesEcbDecryptByHex(cipherTextHex string, key []byte) (plainText []byte, err error)
- func AesEcbEncrypt(plainText, secretKey []byte) (cipherText []byte, err error)
- func AesEcbEncryptBase64(plainText, key []byte) (cipherTextBase64 string, err error)
- func AesEcbEncryptHex(plainText, key []byte) (cipherTextHex string, err error)
- func Bool2String(val bool) string
- func BytesToString(b []byte) string
- func CheckFileExist(filename string) bool
- func Contains(s []int, n int) bool
- func CurrentDir(joinPath ...string) (string, error)
- func Download(title, fileUrl string) error
- func DownloadAudio(title, fileUrl string, opt ID3Options) error
- func FileName(name, ext string) string
- func FilePath(name, ext string, escape bool) (string, error)
- func FileSize(filePath string) (int, bool, error)
- func Float2String(val float64) string
- func FormatSeconds(seconds int) string
- func GetUrlExt(rawURL string) (ext string, err error)
- func Html2Md(htmlStr string) (md string)
- func Html2Pdf(fileName, title, content string) (err error)
- func Int2String(val int) string
- func Int64String(val int64) string
- func LimitLength(s string, length int) string
- func M3u8URLs(uri string) (urls []string, err error)
- func MD5str(s string) string
- func MarshalJSON(v interface{}) ([]byte, error)
- func Md5(text string) string
- func MergeAudio(paths []string, mergedFilePath string) error
- func MergeAudioAndVideo(paths []string, mergedFilePath string) error
- func MergeToMP4(paths []string, mergedFilePath string, filename string) error
- func Mkdir(elem ...string) (string, error)
- func PKCS5Padding(plainText []byte, blockSize int) []byte
- func PKCS5UnPadding(plainText []byte, blockSize int) ([]byte, error)
- func ResolveURL(u *url.URL, p string) string
- func SaveFile(title, content string) error
- func String2Int(val string) int
- func StringToBytes(s string) []byte
- func TimeCost(start time.Time)
- func Unix2String(stamp int64) string
- func UnixMilli2DateString(stamp int64) string
- func UnixMilli2String(stamp int64) string
- func UnmarshalJSON(data []byte, v interface{}) error
- func UnmarshalReader(r io.Reader, v interface{}) error
- func WriteFileWithTrunc(filename, content string) (err error)
- type ID3Options
- type PdfOption
- type ValidUTF8Reader
Constants ¶
View Source
const DateFormat = "2006-01-02"
View Source
const MAXLENGTH = 80
View Source
const TimeFormat = "2006-01-02 15:04:05"
Variables ¶
View Source
var ( ErrCipherKey = errors.New("the secret key is wrong and cannot be decrypted. Please check") ErrKeyLengthSixteen = errors.New("a sixteen or twenty-four or thirty-two length secret key is required") ErrKeyLengthEight = errors.New("a eight-length secret key is required") ErrKeyLengthTwentyFour = errors.New("a twenty-four-length secret key is required") ErrPaddingSize = errors.New("padding size error please check the secret key or iv") ErrIvAes = errors.New("a sixteen-length ivaes is required") ErrIvDes = errors.New("a eight-length ivdes key is required") ErrRsaBits = errors.New("bits 1024 or 2048") )
Functions ¶
func AesEcbDecrypt ¶
func AesEcbDecryptByBase64 ¶
func AesEcbDecryptByHex ¶
func AesEcbEncrypt ¶
func AesEcbEncryptBase64 ¶
func AesEcbEncryptHex ¶
func Bool2String ¶
func BytesToString ¶
func CheckFileExist ¶
func DownloadAudio ¶
func DownloadAudio(title, fileUrl string, opt ID3Options) error
DownloadAudio 下载mp3文件
func Float2String ¶
func Int2String ¶
func Int64String ¶
func MergeAudio ¶
MergeAudio merge audio
func MergeAudioAndVideo ¶
MergeAudioAndVideo merge audio and video
func MergeToMP4 ¶
MergeToMP4 merges video parts to an MP4 file.
func PKCS5Padding ¶
func String2Int ¶
func StringToBytes ¶
func Unix2String ¶
Unix2String 时间戳[转换为]字符串 eg:(2019-09-09 09:09:09)
func UnixMilli2DateString ¶
func UnixMilli2String ¶
UnixMilli2String 时间戳[转换为]字符串 eg:(2019-09-09 09:09:09)
func UnmarshalJSON ¶
UnmarshalJSON 将 data 中的 json 格式的数据, 解析到 v
func UnmarshalReader ¶
UnmarshalReader 将 r 中的 json 格式的数据, 解析到 v
func WriteFileWithTrunc ¶
Types ¶
type ID3Options ¶
type PdfOption ¶
type ValidUTF8Reader ¶
type ValidUTF8Reader struct {
// contains filtered or unexported fields
}
ValidUTF8Reader implements a Reader which reads only bytes that constitute valid UTF-8
func NewValidUTF8Reader ¶
func NewValidUTF8Reader(rd io.Reader) ValidUTF8Reader
NewValidUTF8Reader constructs a new ValidUTF8Reader that wraps an existing io.Reader
Click to show internal directories.
Click to hide internal directories.