Documentation
¶
Index ¶
- Constants
- func Add(a, b int) int
- func Append(args ...string) string
- func Byte2Object(by []byte, v interface{}) error
- func CheckBirthdayValid(nYear, nMonth, nDay int) bool
- func CheckProvinceValid(citizenNo []byte) bool
- func Circle(sourceImg, newImg string)
- func Citizen15To18(citizenNo15 []byte) []byte
- func Clone(src interface{}) interface{}
- func Contains(element interface{}, arrays interface{}) bool
- func CopyDir(dst, src string) error
- func CopyFile(dst, src string) error
- func Covent2Map(value interface{}) map[string]interface{}
- func CoventArray(value interface{}) (list []interface{})
- func CurDir() string
- func Decrypt(decrypted string, key []byte) (string, error)
- func DeepClone(src interface{}) interface{}
- func Deserialize(valueBytes []byte) (interface{}, error)
- func DiffFile(left, right string) (diff string, same bool, err error)
- func Empty(s string) bool
- func Encrypt(text string, key []byte) (string, error)
- func FileExists(filename string) bool
- func FileOpen(filename string) ([]byte, error)
- func FileToURLPath(file string) string
- func FilteredSQLInject(source string) bool
- func Float64ToString(f float64) string
- func ForceCreateFile(filename string) *os.File
- func ForeachFile(path string, pattern string, onFindFile func(fileName string) error) error
- func GetCitizenNoInfo(citizenNo []byte) (birthday int64, isMale bool, addrMask int, err error)
- func GetFileInfo(filename string) (name, ext string, en bool)
- func GetFilelist(path string) []string
- func GetHTTPFile(URL, filePath string) error
- func GetInternetIP() string
- func GetJSONString(i interface{}) string
- func GetKeys(m map[string]interface{}) []string
- func GetRandomString(n int, letterBytes string) string
- func GetStructTagValue(value interface{}, tagName string) (title []string)
- func GetlastModified(file string) time.Time
- func HTTPGet(uri string) ([]byte, error)
- func Int64TString(f int64) string
- func IntFromFloat64(x float64) int
- func IntFromInterface(x interface{}) int
- func IsEmail(email string) bool
- func IsFileSame(left, right string) bool
- func IsLeapYear(nYear int) bool
- func IsMobile(mobile string) bool
- func IsValidCitizenNo(citizenNo *[]byte) bool
- func IsValidCitizenNo18(citizenNo18 *[]byte) bool
- func JSON2Map(jsonStr string) map[string]float64
- func JSON2Object(js string, v interface{}) (interface{}, error)
- func ListDir(path string) []string
- func ListDirFilenane(path string) []string
- func MD5(source string) string
- func Minus(a, b int) int
- func NoneError(err error)
- func NotEmpty(s string) bool
- func Object2Byte(v interface{}) []byte
- func Object2JSON(obj interface{}) string
- func PathExists(path string) bool
- func PostFile(fieldname, filename, uri string) ([]byte, error)
- func PostJSON(uri string, obj interface{}) ([]byte, error)
- func PostJSONWithRespContentType(uri string, obj interface{}) ([]byte, string, error)
- func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
- func PostXML(uri string, obj interface{}) ([]byte, error)
- func PostXMLWithTLS(uri string, obj interface{}, ca, key string) ([]byte, error)
- func PrintExcel(xlsxFile string)
- func ReadExcelFile(filename string) (allRows [][]string, err error)
- func ReadFile(filename string) ([]string, error)
- func ReadFile2String(filename string) (string, error)
- func ReadFileContext(path string) string
- func ReadJSON(obj interface{}, filename string) error
- func ReadString(str string) []string
- func ReadXML(obj interface{}, filename string) error
- func ReflectFilde(i interface{}, name string) (field interface{})
- func ReflectFildes(i interface{}) (field map[string]interface{})
- func ReflectInterfaceName(i interface{}) string
- func ReflectInterfaceTypeValue(i interface{}) (reflectType reflect.Type, reflectValue reflect.Value)
- func ReflectMethod(i interface{}, name string) []reflect.Value
- func RemoveDuplicatesAndEmpty(arr []string) (newArr []string)
- func RemoveFile(file string)
- func SHA1EncodeFileName(filename string) string
- func SaveFile(file string, content string)
- func SaveJSON(filename string, obj interface{}) error
- func SaveUtf8BomFile(file string, content string)
- func SaveXML(filename string, obj interface{}) error
- func ScanFiles(dir string, fileType []string) []string
- func Seize(s interface{}, se string, pos, length int) string
- func Serialize(value interface{}) ([]byte, error)
- func SetLastModified(file string, time time.Time)
- func ShowError(err error)
- func Split(s string, sep string) []interface{}
- func Splits(s string, sep string) []string
- func Start()
- func StrToUInt(str string) uint
- func String(i interface{}) string
- func StringToUint(strNumber string, value interface{}) (err error)
- func Struct2Arrary(i interface{}) (kv []interface{})
- func Time2Timestamp(t string) int64
- func Timestamp2Time(timestamp int64, format string) string
- func Timestamp2Time2(timestamp int64) string
- func UNCPath(path string) string
- func URLToLocalFile(path string) string
- func Uint8FromInt(n int) (uint8, error)
- func UnicodeEmojiCode(s string) string
- func UnicodeEmojiDecode(s string) string
- func WriteFile(file string, data []byte)
- func Years(start, end int) []int
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
- func Zuijin(this int, arr []int) int
- type CircleMask
- type MultipartFormField
Constants ¶
const ( Date = "2006-01-02" Datetime = "2006-01-02 15:04:05" Datetime2 = "2006-01-02T15:04:05Z07:00" Nanosecond = 1 Microsecond = 1000 * Nanosecond Millisecond = 1000 * Microsecond Second = 1000 * Millisecond Minute = 60 * Second Hour = 60 * Minute )
* * 时间格式化
const ( EXTHTML = ".html" EXTXML = ".xml" EXTJSON = ".json" EXTZIP = ".zip" EXTIDOC = ".idoc" EXTZED = ".zed" EXTPDF = ".pdf" )
ExtHTML ExtHTML
Variables ¶
This section is empty.
Functions ¶
func CheckBirthdayValid ¶
CheckBirthdayValid Check birthday's year month day valid.
func CheckProvinceValid ¶
CheckProvinceValid Check province code valid.
func Citizen15To18 ¶
Citizen15To18 Convert citizen 15 to 18.
func Clone ¶
func Clone(src interface{}) interface{}
浅克隆,可以克隆任意数据类型,对指针类型子元素无法克隆 获取类型:如果类型是指针类型,需要使用Elem()获取对象实际类型 获取实际值:如果值是指针类型,需要使用Elem()获取实际数据 说白了,Elem()就是获取反射数据的实际类型和实际值
func FilteredSQLInject ¶
FilteredSQLInject 正则过滤sql注入的方法 参数 : 要匹配的语句
func ForeachFile ¶
ForeachFile 列出目录下所有文件
func GetCitizenNoInfo ¶
GetCitizenNoInfo Get information from citizen number. Birthday, gender, province mask.
func GetFileInfo ¶
GetFileInfo GetFileInfo
func GetKeys ¶
*
- @Description:
- @User: zlt-com <nohairs@gmail.com>
- @Date: 2021-09-27 16:55:17
- @param {map[string]interface{}} m
- @return {*}
func GetRandomString ¶
GetRandomString 生成随机字符串
func GetStructTagValue ¶
GetStructTagValue struct中tag的值
func IsValidCitizenNo ¶
IsValidCitizenNo Check citizen number valid.
func IsValidCitizenNo18 ¶
IsValidCitizenNo18 Check citizen number 18 valid.
func PostJSONWithRespContentType ¶
PostJSONWithRespContentType post json数据请求,且返回数据类型
func PostMultipartForm ¶
func PostMultipartForm(fields []MultipartFormField, uri string) (respBody []byte, err error)
PostMultipartForm 上传文件或其他多个字段
func PostXMLWithTLS ¶
PostXMLWithTLS perform a HTTP/POST request with XML body and TLS
func ReadExcelFile ¶
ReadExcelFile ReadExcelFile
func ReadFile2String ¶
ReadFile2String ReadFile2String
func ReflectInterfaceName ¶
func ReflectInterfaceName(i interface{}) string
func SHA1EncodeFileName ¶
SHA1EncodeFileName SHA1EncodeFileName
func SaveUtf8BomFile ¶
SaveUtf8BomFile 保存utf-8 bom文件
func StringToUint ¶
StringToUint 字符串转uint
func Timestamp2Time ¶
Timestamp2Time 时间戳转字符串
func ZeroPadding ¶
ZeroPadding ZeroPadding
Types ¶
type CircleMask ¶
type CircleMask struct {
// contains filtered or unexported fields
}
CircleMask CircleMask
func NewCircleMask ¶
NewCircleMask NewCircleMask