Documentation ¶
Index ¶
- Constants
- func CamelCaseSlices(s string) []string
- func CamelCaseString(s string) string
- func ConvertObjectToMapData(v interface{}, tag string) map[string]interface{}
- func CopyMapperDataToObject(src map[string]interface{}, dst interface{})
- func CopyObjectSimply(src interface{}, dst interface{}, skipEmpty bool)
- func CurrentMillisecond() int64
- func DeeplyCopyObject(src interface{}, dst interface{}) error
- func EnsureDirectory(path string) error
- func FormDataCopyFields(formData interface{}, dest interface{}, tagName string) int
- func GB18030ToUtf8(s []byte) ([]byte, error)
- func GB2312ToUtf8(s []byte) ([]byte, error)
- func GbkToUtf8(s []byte) ([]byte, error)
- func GenLoweruuid() string
- func GenUUID() string
- func GetDigistIndex(digists string, c byte) int
- func GetLastPartString(text string) string
- func GetRemoteAddress(r *http.Request) string
- func GetSOAPAction(r *http.Request) string
- func HashCode(content []byte) uint32
- func HashCodeAsInt(content []byte) int
- func HumanByteSize(bs int) string
- func HumanByteText(bs []byte) string
- func HumanToTimestamp(format string, v string) int64
- func IncreaseValueCustomizedDigist(val string, digists string) string
- func IsCapital(s string) bool
- func IsEmpty(val interface{}) bool
- func IsInList(key int, list []int) bool
- func IsNumberic(val interface{}) bool
- func IsObjectEquals(l interface{}, r interface{}) bool
- func IsPathExists(path string) bool
- func IsPathNotExists(path string) bool
- func IsStringMapEquals(src, dst map[string]string) bool
- func JSONObjUnmarshal(in *map[string]interface{}, out interface{}) error
- func KebabCaseString(s string) string
- func Md5Encode(val string) string
- func ObjectIDToString(val interface{}) string
- func ParsePropertyTagValue(text string) (string, map[string]string)
- func ParseRemoteIP(val string) string
- func PascalCaseString(s string) string
- func RandomInt(n int) int
- func RandomString(l int) string
- func RemoveItemFromList(v string, l []string) []string
- func SnakeCaseString(s string) string
- func SubStringFromUTF8(s string, length int, start int, markDots bool) string
- func SubStringUTF8(s string, length int, start ...int) string
- func TimeToHuman(format string, t time.Time) string
- func TimestampToHuman(format string, ts int64) string
- func TimestampToHumanYYYYMMDD(ts int64) string
- func ToBoolean(val interface{}) bool
- func ToDouble(val interface{}) float64
- func ToFloat(val interface{}) float32
- func ToInt(val interface{}) int
- func ToInt64(val interface{}) int64
- func ToString(val interface{}) string
- func ToUint64(val interface{}) uint64
- func URLDecode(val string) string
- func URLEncode(val string) string
- func URLPathJoin(path string, paths ...string) string
- func Utf8ToGbk(s []byte) ([]byte, error)
- type CoMapData
- type Timer
- type TimerCallback
Constants ¶
const ( SizeGB = 1024 * 1024 * 1024 SizeMB = 1024 * 1024 SizeKB = 1024 DecadeKB = 10240 )
Constants
const (
CharactorsBase = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
)
Constants
Variables ¶
This section is empty.
Functions ¶
func CamelCaseSlices ¶
CamelCaseSlices splits XxYy into ["Xx", "Yy"]
func ConvertObjectToMapData ¶
ConvertObjectToMapData converter
func CopyMapperDataToObject ¶
func CopyMapperDataToObject(src map[string]interface{}, dst interface{})
CopyMapperDataToObject copy data
func CopyObjectSimply ¶
func CopyObjectSimply(src interface{}, dst interface{}, skipEmpty bool)
CopyObjectSimply copy object
func DeeplyCopyObject ¶
func DeeplyCopyObject(src interface{}, dst interface{}) error
DeeplyCopyObject deeply copy src object to dst object
func EnsureDirectory ¶
EnsureDirectory check the directory exists and create it if not exists
func FormDataCopyFields ¶
FormDataCopyFields copy form data fields into db model fields
func GB18030ToUtf8 ¶
GB18030ToUtf8 converts gbk encoding text into utf-8
func GB2312ToUtf8 ¶
GB2312ToUtf8 converts gbk encoding text into utf-8
func GetDigistIndex ¶
GetDigistIndex get digist index
func GetLastPartString ¶
GetLastPartString get last slice of the text
func GetRemoteAddress ¶
GetRemoteAddress get http request remote ip
func HashCodeAsInt ¶
HashCodeAsInt hashes a buffer to a unique hashcode
func HumanByteSize ¶
HumanByteSize convert byte size as human recognizable
func HumanByteText ¶
HumanByteText convert byte data as human readable text, not like %q contains quatations
func HumanToTimestamp ¶
HumanToTimestamp converter
func IncreaseValueCustomizedDigist ¶
IncreaseValueCustomizedDigist increase
func IsObjectEquals ¶
func IsObjectEquals(l interface{}, r interface{}) bool
IsObjectEquals deeply compare two objects that if equals
func IsPathNotExists ¶
IsPathNotExists check if the path not exists
func IsStringMapEquals ¶
IsStringMapEquals boolean
func JSONObjUnmarshal ¶
JSONObjUnmarshal unmarshal object
func KebabCaseString ¶
KebabCaseString converts XxYy to xx-yy, XxYY to xx-yy
func ObjectIDToString ¶
func ObjectIDToString(val interface{}) string
ObjectIDToString convert objectid to string
func ParsePropertyTagValue ¶
ParsePropertyTagValue parse go tag value as property name and attributes
func PascalCaseString ¶
PascalCaseString converts xx_yy to XxYy
func RemoveItemFromList ¶
RemoveItemFromList remove element from list
func SnakeCaseString ¶
SnakeCaseString converts XxYy to xx_yy, XxYY to xx_yy
func SubStringFromUTF8 ¶
SubStringFromUTF8 sub utf-8 encode string to support chinese text submation this method avoids the traditional []rune() method to optimize the execution time
func SubStringUTF8 ¶
SubStringUTF8 sub utf-8 encode string to support chinese text submation this method avoids the traditional []rune() method to optimize the execution time
func TimestampToHuman ¶
TimestampToHuman formatter
func TimestampToHumanYYYYMMDD ¶
TimestampToHumanYYYYMMDD formatter
Types ¶
type CoMapData ¶
type CoMapData struct {
// contains filtered or unexported fields
}
CoMapData map data for concurrency coroutine operation
func NewCoMapData ¶
func NewCoMapData() *CoMapData
NewCoMapData new a concurrency coroutine operational map data
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer for processs
func NewTimer ¶
func NewTimer(delayMillisec int64, durationMillisec int64, cb TimerCallback, delegate interface{}) (*Timer, error)
NewTimer and run the timer