utils

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2020 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CharactorsBase = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
)

Constants

Variables

This section is empty.

Functions

func ConvertObjectToMapData

func ConvertObjectToMapData(v interface{}, tag string) map[string]interface{}

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 CurTimestampMiliSec

func CurTimestampMiliSec() int64

CurTimestampMiliSec millisecond

func DeeplyCopyObject

func DeeplyCopyObject(src interface{}, dst interface{}) error

DeeplyCopyObject deeply copy src object to dst object

func EnsureDirectory

func EnsureDirectory(path string) error

EnsureDirectory check the directory exists and create it if not exists

func GenLoweruuid

func GenLoweruuid() string

GenLoweruuid generate uuid with lower characters

func GenUUID

func GenUUID() string

GenUUID generate uuid with upper characters

func GetDigistIndex

func GetDigistIndex(digists string, c byte) int

GetDigistIndex get digist index

func GetLastPartString

func GetLastPartString(text string) string

GetLastPartString get last slice of the text

func GetRemoteAddress

func GetRemoteAddress(r *http.Request) string

GetRemoteAddress get http request remote ip

func GetSOAPAction

func GetSOAPAction(r *http.Request) string

GetSOAPAction get soap action

func HumanToTimestamp

func HumanToTimestamp(format string, v string) int64

HumanToTimestamp converter

func IncreaseValueCustomizedDigist

func IncreaseValueCustomizedDigist(val string, digists string) string

IncreaseValueCustomizedDigist increase

func IsEmpty

func IsEmpty(val interface{}) bool

IsEmpty boolean

func IsInList

func IsInList(key int, list []int) bool

IsInList whether a value is in the list

func IsStringMapEquals

func IsStringMapEquals(src, dst map[string]string) bool

IsStringMapEquals boolean

func JSONObjUnmarshal

func JSONObjUnmarshal(in *map[string]interface{}, out interface{}) error

JSONObjUnmarshal unmarshal object

func Md5Encode

func Md5Encode(val string) string

Md5Encode md5 encode

func ObjectIDToString

func ObjectIDToString(val interface{}) string

ObjectIDToString convert objectid to string

func ParseRemoteIP

func ParseRemoteIP(val string) string

ParseRemoteIP parse remote ip

func RandomString

func RandomString(l int) string

RandomString random string

func RemoveItemFromList

func RemoveItemFromList(v string, l []string) []string

RemoveItemFromList remove element from list

func TimeToHuman

func TimeToHuman(format string, t time.Time) string

TimeToHuman formatter

func TimestampToHuman

func TimestampToHuman(format string, ts int64) string

TimestampToHuman formatter

func TimestampToHumanYYYYMMDD

func TimestampToHumanYYYYMMDD(ts int64) string

TimestampToHumanYYYYMMDD formatter

func ToBoolean

func ToBoolean(val interface{}) bool

ToBoolean converter

func ToDouble

func ToDouble(val interface{}) float64

ToDouble converter

func ToFloat

func ToFloat(val interface{}) float32

ToFloat converter

func ToInt

func ToInt(val interface{}) int

ToInt convert to int

func ToInt64

func ToInt64(val interface{}) int64

ToInt64 converter

func ToString

func ToString(val interface{}) string

ToString convert to string

func ToUint64

func ToUint64(val interface{}) uint64

ToUint64 converter

func URLDecode

func URLDecode(val string) string

URLDecode url decode

func URLEncode

func URLEncode(val string) string

URLEncode url encode

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL