Documentation ¶
Index ¶
- func Array2Str(s interface{}) string
- func CopyFields(a interface{}, b interface{}, fields ...string) (err error)
- func FromBytes(bytes []byte) string
- func GbkAsUtf8(str string) string
- func GetBase64ByFile(path string) (string, error)
- func GetRandomString(lens int) string
- func IsContain(items []string, item string) bool
- func IsEmail(b []byte) bool
- func JobKey(taskId, serverId int) int
- func LCS(s1 string, s2 string) string
- func Md5(buf []byte) string
- func SetPassword(len int, pwdO string) (pwd string, salt string)
- func Struct2Map(obj interface{}) map[string]interface{}
- func Struct2MapByTag(obj interface{}, tagName string) map[string]interface{}
- func ToBytes(str string) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFields ¶
用b的所有字段覆盖a的 如果fields不为空, 表示用b的特定字段覆盖a的 a应该为结构体指针
func GetBase64ByFile ¶
func LCS ¶
LCS gets the longest common substring of s1 and s2.
Refers to http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring.
func Struct2Map ¶
func Struct2Map(obj interface{}) map[string]interface{}
结构体转map gorm Updates不会更新结构体里的0及空,需转换成map 此方法不适用此情景,更新为Struct2MapByTag
func Struct2MapByTag ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.