Documentation ¶
Index ¶
- Variables
- func CsvToStr2d(path string) ([][]string, error)
- func Decrypt(cipherText string, key string, iv string) (string, error)
- func DeduplicateStrArrWithMap(arr []string) []string
- func Encrypt(plainText string, key string, iv string) (string, error)
- func Get(getUrl string, timeout time.Duration) (httpStatusCode int, resBody string, err error)
- func IndexStrArr(s string, arr []string) int
- func PostComplexDeliverV2(postUrl string, mainJsonS CdMainJson, filePaths []string) (httpStatusCode int, resBody string, err error)
- func PostForm(postUrl string, valMap map[string]string, fileMap map[string]string) (httpStatusCode int, resBody string, err error)
- func SqlToStr2d(Db *gorm.DB, sql string, withHeader bool) (str2dP *[][]string, resErr error)
- func Str3dToXlsx(str3d [][][]string, dir string, fileName string) (realativeFilePath string, err error)
- func StrArrEqual(arr1 []string, arr2 []string) bool
- func StrArraysIntersect(arr1 []string, arr2 []string) []string
- func StringPurgerForMatch(txt string) string
- func ToString(any interface{}) string
- func WechatStr2dTablizeRender(str2d [][]string) (string, error)
- func XlsxToStr3d(path string) ([][][]string, error)
- type CdFormItem
- type CdMainJson
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorKeyLenInvalid = errors.New("length of key invalid")
View Source
var ErrorViLenInvalid = errors.New("length of iv invalid")
Functions ¶
func CsvToStr2d ¶
func DeduplicateStrArrWithMap ¶
字符串切片去重(用hashMap)
func IndexStrArr ¶
IndexStrArr return the first index of string s found in arr; If not found ,return -1
func PostComplexDeliverV2 ¶
func PostForm ¶
func PostForm(postUrl string, valMap map[string]string, fileMap map[string]string) (httpStatusCode int, resBody string, err error)
PostForm simulate the front-end initiating a form request; @param valMap map[string]string stores the form field name and form value. @param fileMap map[string]string stores the form field name and file path.
func SqlToStr2d ¶
SqlToStr2d 执行sql,导出字符串二维数组,withHeader为true则str2d[1]为sql结果的列名 dsn := "user:pwd@tcp(192.168.1.173:3306)/dbName?charset=utf8&parseTime=True&loc=Local" db, err := gorm.Open(mysql.Open(dsn))
func Str3dToXlsx ¶
func Str3dToXlsx(str3d [][][]string, dir string, fileName string) (realativeFilePath string, err error)
三维字符串数组转换为xlsx,错误则返回空路径和err
func StringPurgerForMatch ¶
StringPurgerForMatch 去除标点空格,英文字母转为小写,中文数字转化为阿拉伯数字
func WechatStr2dTablizeRender ¶
(为微信)二维字符串数组对齐,不足补空格,默认第一行为表头; 如果str2d行宽度不一致,报错。
func XlsxToStr3d ¶
Types ¶
type CdFormItem ¶
type CdMainJson ¶
type CdMainJson struct { Title string `json:"title"` GroupName string `json:"group_name"` MailDstTag string `json:"mail_dst_tag"` MailDsts string `json:"mail_dsts"` FormItems []CdFormItem `json:"form_items"` }
Click to show internal directories.
Click to hide internal directories.