Documentation ¶
Index ¶
- func Abs(number float64) float64
- func Add(m, n interface{}) int
- func Addslashes(str string) string
- func ArgStringToAryInterface(d []string) []interface{}
- func ArrayChunk(s []interface{}, size int) [][]interface{}
- func ArrayColumn(input map[string]map[string]interface{}, columnKey string) []interface{}
- func ArrayCombine(s1, s2 []interface{}) map[interface{}]interface{}
- func ArrayFill(startIndex int, num uint, value interface{}) map[int]interface{}
- func ArrayFlip(m map[interface{}]interface{}) map[interface{}]interface{}
- func ArrayKeyExists(key interface{}, m map[interface{}]interface{}) bool
- func ArrayKeyPluck(data []map[string]string, value, key string) map[string]string
- func ArrayKeys(elements map[interface{}]interface{}) []interface{}
- func ArrayMerge(ss ...[]interface{}) []interface{}
- func ArrayMultiPluck(data []map[string]string, key string) map[string]map[string]string
- func ArrayPad(s []interface{}, size int, val interface{}) []interface{}
- func ArrayPluck(data []map[string]string, value string) []string
- func ArrayPop(s *[]interface{}) interface{}
- func ArrayPush(s *[]interface{}, elements ...interface{}) int
- func ArrayRand(elements []interface{}) []interface{}
- func ArrayRandMap(elements []map[string]string) []map[string]string
- func ArrayRemoveRepeatedElement(arr []string) (newArr []string)
- func ArrayReverse(s []interface{}) []interface{}
- func ArrayShift(s *[]interface{}) interface{}
- func ArraySlice(s []interface{}, offset, length uint) []interface{}
- func ArrayStringUniq(arr []string) (newArr []string)
- func ArrayUnshift(s *[]interface{}, elements ...interface{}) int
- func ArrayValues(elements map[interface{}]interface{}) []interface{}
- func AryInterfaceToArgString(d []interface{}) []string
- func AryMapInterfaceToAryMapString(d []map[string]interface{}) []map[string]string
- func AryMapStringToAryMapInterface(d []map[string]string) []map[string]interface{}
- func Base64Decode(str string) (string, error)
- func Base64Encode(str string) string
- func BaseConvert(number string, frombase, tobase int) (string, error)
- func Basename(path string) string
- func Bin2hex(str string) (string, error)
- func Bindec(str string) (string, error)
- func ByteReplace(s, old, new []byte, n int) []byte
- func Ceil(value float64) float64
- func Checkdate(month, day, year int) bool
- func Chmod(filename string, mode os.FileMode) error
- func Chown(filename string, uid, gid int) error
- func Chr(ascii int) string
- func ChunkSplit(body string, chunklen uint, end string) string
- func ConvertBson(items bson.D, item bson.E) bson.D
- func Copy(source, dest string) (bool, error)
- func Crc32(str string) uint32
- func Date(format string, ts ...time.Time) string
- func DateTimeParse(st string) (int, error)
- func DateToJulian(year int, month time.Month, day int) (dayNo int)
- func Day(s string, e string) ([]string, []int64)
- func DebugFormat(i interface{}) string
- func Decbin(number int64) string
- func Dechex(number int64) string
- func Decoct(number int64) string
- func Delete(filename string) error
- func Dial(addr string, timeout time.Duration) error
- func Die(status int)
- func Divide(m, n interface{}) bool
- func DomainStatic(p, v string) string
- func Echo(args ...interface{})
- func Empty(val interface{}) bool
- func Exec(command string, output *[]string, returnVar *int) string
- func Exit(status int)
- func Explode(delimiter, str string) []string
- func ExtractIP(addr string) (string, error)
- func Fclose(handle *os.File) error
- func Fgetcsv(handle *os.File, length int, delimiter rune) ([][]string, error)
- func FileExists(filename string) bool
- func FileGetContents(filename string) (string, error)
- func FilePutContents(filename string, data string, mode os.FileMode) error
- func FileSize(filename string) (int64, error)
- func Filemtime(filename string) (int64, error)
- func Floor(value float64) float64
- func FormatDate(str interface{}) string
- func FormatDateTime(str interface{}) string
- func FormatDuring(t time.Time) string
- func FromYearWeek(year, month, day int) (wyear, week int)
- func FunctionName(i interface{}) string
- func GetAppRootPath() string
- func GetCurrentDirectory() string
- func GetHourDiffer(startTime, endTime interface{}) int64
- func GetIPs() (ips []string)
- func GetLocalIP() (string, error)
- func GetLocalMainIP() (string, int, error)
- func GetMacAddrs() (macAddrs []string)
- func GetMissingElement(arr []int) int
- func GetParentDirectory(dirctory string) string
- func GetTimeZone() *time.Location
- func Getcwd() (string, error)
- func Getenv(varname string) string
- func GethostByAddr(ipAddress string) (string, error)
- func GethostByName(hostname string) (string, error)
- func GethostByNamel(hostname string) ([]string, error)
- func Gethostname() (string, error)
- func Glob(pattern string) ([]string, error)
- func HTMLEntityDecode(str string) string
- func HTTPBuildQuery(queryData url.Values) string
- func Hex2bin(data string) (string, error)
- func Hexdec(str string) (int64, error)
- func Hour(s string, e string) ([]string, []int64)
- func Htmlentities(str string) string
- func IP2long(ipAddress string) uint32
- func ISOWeekday(year int, month time.Month, day int) (weekday int)
- func Implode(glue string, pieces []string) string
- func InArray(needle interface{}, haystack interface{}) bool
- func InterfaceToString(data []interface{}) (s []string)
- func IsDir(filename string) (bool, error)
- func IsFile(filename string) bool
- func IsNan(val float64) bool
- func IsNumeric(val interface{}) bool
- func IsReadable(filename string) bool
- func IsWriteable(filename string) bool
- func JS(v string) template.JS
- func JSONDecode(data []byte, val interface{}) error
- func JSONEncode(val interface{}) ([]byte, error)
- func JulianToDate(dayNo int) (year int, month time.Month, day int)
- func LcFirst(str string) string
- func Levenshtein(str1, str2 string, costIns, costRep, costDel int) int
- func LocalListener() net.Listener
- func Long2ip(properAddress uint32) string
- func Ltrim(str string, characterMask ...string) string
- func MapInterfaceToMapString(d map[string]interface{}) map[string]string
- func MapStringToMapInterface(d map[string]string) map[string]interface{}
- func MarshalHTML(v interface{}) template.HTML
- func MarshalJS(v interface{}) template.JS
- func Max(nums ...float64) float64
- func MbStrlen(str string) int
- func Md5(str string) string
- func Md5File(path string) (string, error)
- func MemoryGetUsage(realUsage bool) uint64
- func Min(nums ...float64) float64
- func Mkdir(filename string, mode os.FileMode) error
- func MkdirAll(filename string, mode os.FileMode) error
- func Month(d string) ([]string, []int64)
- func MonthDate(d string) (string, string)
- func MultiArray(haystack interface{}) bool
- func NewReplacer(endpoint string, values ...interface{}) string
- func NextMonthDate(d string) (string, string)
- func Nl2br(str string, isXhtml bool) string
- func Now() time.Time
- func NumberFormat(number float64, decimals uint, decPoint, thousandsSep string) string
- func Octdec(str string) (int64, error)
- func Ord(char string) int
- func Pack(order binary.ByteOrder, data interface{}) (string, error)
- func ParseStr(encodedString string, result map[string]interface{}) error
- func ParseURL(str string, component int) (map[string]string, error)
- func Passthru(command string, returnVar *int)
- func Pathinfo(path string, options int) map[string]string
- func Pi() float64
- func Ping(host string, port int) error
- func Pipeline(str string) mongo.Pipeline
- func PrevMonthDate(d string) (string, string)
- func Putenv(setting string) error
- func Quotemeta(str string) string
- func Rand(min, max int) int
- func Random() string
- func Rawurldecode(str string) (string, error)
- func Rawurlencode(str string) string
- func Realpath(path string) (string, error)
- func Rename(oldname, newname string) error
- func Round(value float64) float64
- func Rtrim(str string, characterMask ...string) string
- func SetTimeZone(zone string) *time.Location
- func Sha1(str string) string
- func Sha1File(path string) (string, error)
- func SimilarText(first, second string, percent *float64) int
- func Sleep(t int64)
- func Soundex(str string) string
- func SplitString(p, split string, space bool) string
- func StartDate(wyear, week int) (year int, month time.Month, day int)
- func Stat(filename string) (os.FileInfo, error)
- func Static(p, v string) string
- func StrLastChar(s string) string
- func StrPad(str1, str2 string, i int) string
- func StrRepeat(input string, multiplier int) string
- func StrReplace(search, replace, subject string, count int) string
- func StrRipos(haystack, needle string, offset int) int
- func StrRpos(haystack, needle string, offset int) int
- func StrShuffle(str string) string
- func StrToInt(str string, val int) int
- func StrToInt64(str string, val int64) int64
- func StrToLower(str string) string
- func StrToTime(format, strtime string) (int64, error)
- func StrToUpper(str string) string
- func StrTrim(str string) string
- func StrWordCount(str string) []string
- func StringToDate(s string) (time.Time, error)
- func Stripos(haystack, needle string, offset int) int
- func Stripslashes(str string) string
- func Strlen(str string) int
- func Strpos(haystack, needle string, offset int) int
- func Strrev(str string) string
- func Strstr(haystack string, needle string) string
- func Strtr(haystack string, params ...interface{}) string
- func Substr(str string, start uint, length int) string
- func System(command string, returnVar *int) string
- func Tag(i interface{}) string
- func Ternary(condition bool, trueVal, falseVal interface{}) interface{}
- func Time() int64
- func Timestamp() int64
- func ToBool(i interface{}) bool
- func ToBoolE(i interface{}) (bool, error)
- func ToBoolSlice(i interface{}) []bool
- func ToBoolSliceE(i interface{}) ([]bool, error)
- func ToDuration(i interface{}) time.Duration
- func ToDurationE(i interface{}) (d time.Duration, err error)
- func ToDurationSlice(i interface{}) []time.Duration
- func ToDurationSliceE(i interface{}) ([]time.Duration, error)
- func ToFloat32(i interface{}) float32
- func ToFloat32E(i interface{}) (float32, error)
- func ToFloat64(i interface{}) float64
- func ToFloat64E(i interface{}) (float64, error)
- func ToInt(i interface{}) int
- func ToInt16(i interface{}) int16
- func ToInt16E(i interface{}) (int16, error)
- func ToInt32(i interface{}) int32
- func ToInt32E(i interface{}) (int32, error)
- func ToInt64(i interface{}) int64
- func ToInt64E(i interface{}) (int64, error)
- func ToInt8(i interface{}) int8
- func ToInt8E(i interface{}) (int8, error)
- func ToIntE(i interface{}) (int, error)
- func ToIntSlice(i interface{}) []int
- func ToIntSliceE(i interface{}) ([]int, error)
- func ToSlice(i interface{}) []interface{}
- func ToSliceE(i interface{}) ([]interface{}, error)
- func ToString(i interface{}) string
- func ToStringE(i interface{}) (string, error)
- func ToStringMap(i interface{}) map[string]interface{}
- func ToStringMapBool(i interface{}) map[string]bool
- func ToStringMapBoolE(i interface{}) (map[string]bool, error)
- func ToStringMapE(i interface{}) (map[string]interface{}, error)
- func ToStringMapInt(i interface{}) map[string]int
- func ToStringMapInt64(i interface{}) map[string]int64
- func ToStringMapInt64E(i interface{}) (map[string]int64, error)
- func ToStringMapIntE(i interface{}) (map[string]int, error)
- func ToStringMapString(i interface{}) map[string]string
- func ToStringMapStringE(i interface{}) (map[string]string, error)
- func ToStringMapStringSlice(i interface{}) map[string][]string
- func ToStringMapStringSliceE(i interface{}) (map[string][]string, error)
- func ToStringSlice(i interface{}) []string
- func ToStringSliceE(i interface{}) ([]string, error)
- func ToTime(i interface{}) time.Time
- func ToTimeE(i interface{}) (tim time.Time, err error)
- func ToUint(i interface{}) uint
- func ToUint16(i interface{}) uint16
- func ToUint16E(i interface{}) (uint16, error)
- func ToUint32(i interface{}) uint32
- func ToUint32E(i interface{}) (uint32, error)
- func ToUint64(i interface{}) uint64
- func ToUint64E(i interface{}) (uint64, error)
- func ToUint8(i interface{}) uint8
- func ToUint8E(i interface{}) (uint8, error)
- func ToUintE(i interface{}) (uint, error)
- func ToWeekDay(t interface{}) string
- func Touch(filename string) (bool, error)
- func Trim(str string, characterMask ...string) string
- func URLDecode(str string) (string, error)
- func URLEncode(str string) string
- func UcFirst(str string) string
- func UcWords(str string) string
- func UnescapeString(v interface{}) string
- func Uniqid(prefix string) string
- func UnixTimeFormatDate(str interface{}) string
- func Unlink(filename string) error
- func Unpack(order binary.ByteOrder, data string) (interface{}, error)
- func Usleep(t int64)
- func VerifyEmail(email string) bool
- func VerifyIPv4(address string) bool
- func VerifyIPv6(address string) bool
- func VerifyPhone(phone string) bool
- func VersionCompare(version1, version2, operator string) bool
- func Wordwrap(str string, width uint, br string, cut bool) string
- func ZhCharToFirstPinyin(p string) string
- func ZhCharToPinyin(p string) string
- func ZipOpen(filename string) (*zip.ReadCloser, error)
- type URL
- func (u *URL) Password() (string, bool)
- func (u *URL) Query() url.Values
- func (u *URL) QueryBool(field string, expect bool) (ret bool)
- func (u *URL) QueryDuration(field string, expect time.Duration) (ret time.Duration)
- func (u *URL) QueryInt(field string, expect int) (ret int)
- func (u *URL) QueryInt64(field string, expect int64) (ret int64)
- func (u *URL) QueryString(field string, expect string) (ret string)
- func (u *URL) Username() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgStringToAryInterface ¶
func ArgStringToAryInterface(d []string) []interface{}
func ArrayChunk ¶
func ArrayChunk(s []interface{}, size int) [][]interface{}
ArrayChunk array_chunk()
func ArrayColumn ¶
ArrayColumn array_column()
func ArrayCombine ¶
func ArrayCombine(s1, s2 []interface{}) map[interface{}]interface{}
ArrayCombine array_combine()
func ArrayFlip ¶
func ArrayFlip(m map[interface{}]interface{}) map[interface{}]interface{}
ArrayFlip array_flip()
func ArrayKeyExists ¶
func ArrayKeyExists(key interface{}, m map[interface{}]interface{}) bool
ArrayKeyExists array_key_exists()
func ArrayKeyPluck ¶
func ArrayKeys ¶
func ArrayKeys(elements map[interface{}]interface{}) []interface{}
ArrayKeys array_keys()
func ArrayMultiPluck ¶ added in v1.6.3
func ArrayPad ¶
func ArrayPad(s []interface{}, size int, val interface{}) []interface{}
ArrayPad array_pad()
func ArrayPop ¶
func ArrayPop(s *[]interface{}) interface{}
ArrayPop array_pop() Pop the element off the end of slice
func ArrayPush ¶
func ArrayPush(s *[]interface{}, elements ...interface{}) int
ArrayPush array_push() Push one or more elements onto the end of slice
func ArrayRandMap ¶
ArrayRandMap 随即
func ArrayRemoveRepeatedElement ¶ added in v1.6.27
ArrayRemoveRepeatedElement 数组去重
func ArrayShift ¶
func ArrayShift(s *[]interface{}) interface{}
ArrayShift array_shift() Shift an element off the beginning of slice
func ArraySlice ¶
func ArraySlice(s []interface{}, offset, length uint) []interface{}
ArraySlice array_slice()
func ArrayStringUniq ¶ added in v1.3.4
ArrayStringUniq 数组去重
func ArrayUnshift ¶
func ArrayUnshift(s *[]interface{}, elements ...interface{}) int
ArrayUnshift array_unshift() Prepend one or more elements to the beginning of a slice
func ArrayValues ¶
func ArrayValues(elements map[interface{}]interface{}) []interface{}
ArrayValues array_values()
func AryInterfaceToArgString ¶
func AryInterfaceToArgString(d []interface{}) []string
func BaseConvert ¶
BaseConvert base_convert()
func ByteReplace ¶ added in v1.6.23
func ChunkSplit ¶
ChunkSplit chunk_split()
func DateToJulian ¶
DateToJulian converts a date to a Julian day number.
func DomainStatic ¶ added in v1.6.22
func Exec ¶
Exec exec() returnVar, 0: succ; 1: fail Return the last line from the result of the command. command format eg:
"ls -a" "/bin/bash -c \"ls -a\""
func FileGetContents ¶
FileGetContents file_get_contents()
func FilePutContents ¶
FilePutContents file_put_contents()
func FormatDate ¶ added in v1.4.1
func FormatDate(str interface{}) string
func FormatDateTime ¶ added in v1.4.14
func FormatDateTime(str interface{}) string
func FromYearWeek ¶
func GetHourDiffer ¶ added in v1.5.1
func GetHourDiffer(startTime, endTime interface{}) int64
GetHourDiffer 获取相差时间
func GetMissingElement ¶ added in v1.2.20
func GethostByAddr ¶
GethostByAddr GethostByAddr() Get the Internet host name corresponding to a given IP address
func GethostByName ¶
GethostByName GethostByName() Get the IPv4 address corresponding to a given Internet host name
func GethostByNamel ¶
GethostByNamel GethostByNamel() Get a list of IPv4 addresses corresponding to a given Internet host name
func HTMLEntityDecode ¶
HTMLEntityDecode html_entity_decode()
func HTTPBuildQuery ¶
HTTPBuildQuery http_build_query()
func ISOWeekday ¶
ISOWeekday returns the ISO 8601 weekday number of given day. (1 = Mon, 2 = Tue,.. 7 = Sun)
This is different from Go's standard time.Weekday.
func InArray ¶
func InArray(needle interface{}, haystack interface{}) bool
InArray in_array() haystack supported types: slice, array or map
func InterfaceToString ¶
func InterfaceToString(data []interface{}) (s []string)
func IsNumeric ¶
func IsNumeric(val interface{}) bool
IsNumeric is_numeric() Numeric strings consist of optional sign, any number of digits, optional decimal part and optional exponential part. Thus +0123.45e6 is a valid numeric value. In PHP hexadecimal (e.g. 0xf4c3b00c) is not supported, but IsNumeric is supported.
func JulianToDate ¶
JulianToDate converts a Julian day number to a date.
func Levenshtein ¶
Levenshtein levenshtein() costIns: Defines the cost of insertion. costRep: Defines the cost of replacement. costDel: Defines the cost of deletion.
func LocalListener ¶ added in v1.1.22
LocalListener 随机一个本地端口,返回listener
func MapInterfaceToMapString ¶
func MapStringToMapInterface ¶
func MarshalHTML ¶
func MemoryGetUsage ¶
MemoryGetUsage memory_get_usage() return in bytes
func NewReplacer ¶ added in v1.6.23
func NextMonthDate ¶
NextMonthDate 获取当前日期的下个月的第一天和最后一天
func NumberFormat ¶
NumberFormat number_format() decimals: Sets the number of decimal points. decPoint: Sets the separator for the decimal point. thousandsSep: Sets the thousands separator.
func ParseStr ¶
ParseStr parse_str() f1=m&f2=n -> map[f1:m f2:n] f[a]=m&f[b]=n -> map[f:map[a:m b:n]] f[a][a]=m&f[a][b]=n -> map[f:map[a:map[a:m b:n]]] f[]=m&f[]=n -> map[f:[m n]] f[a][]=m&f[a][]=n -> map[f:map[a:[m n]]] f[][]=m&f[][]=n -> map[f:[map[]]] // Currently does not support nested slice. f=m&f[a]=n -> error // This is not the same as PHP. a .[[b=c -> map[a___[b:c]
func ParseURL ¶
ParseURL parse_url() Parse a URL and return its components -1: all; 1: scheme; 2: host; 4: port; 8: user; 16: pass; 32: path; 64: query; 128: fragment
func Pathinfo ¶
Pathinfo pathinfo() -1: all; 1: dirname; 2: basename; 4: extension; 8: filename Usage: Pathinfo("/home/go/path/src/php2go/php2go.go", 1|2|4|8)
func PrevMonthDate ¶
NextMonthDate 获取当前日期的上个月的第一天和最后一天
func SimilarText ¶
SimilarText similar_text()
func SplitString ¶
分割字符串 p 字符串, split 分隔符 , space 是否需要保留文字中的空格
func StrReplace ¶
StrReplace str_replace()
func StrToInt64 ¶
func StrToTime ¶
StrToTime StrToTime() StrToTime("02/01/2006 15:04:05", "02/01/2016 15:04:05") == 1451747045 StrToTime("3 04 PM", "8 41 PM") == -62167144740
func StringToDate ¶
StringToDate attempts to parse a string into a time.Time type using a predefined list of formats. If no suitable format is found, an error is returned.
func Strtr ¶
Strtr strtr()
If the parameter length is 1, type is: map[string]string Strtr("baab", map[string]string{"ab": "01"}) will return "ba01" If the parameter length is 2, type is: string, string Strtr("baab", "ab", "01") will return "1001", a => 0; b => 1.
func System ¶
System system() returnVar, 0: succ; 1: fail Returns the last line of the command output on success, and "" on failure.
func Ternary ¶
func Ternary(condition bool, trueVal, falseVal interface{}) interface{}
Ternary Ternary expression max := Ternary(a > b, a, b).(int)
func ToBoolSlice ¶
func ToBoolSlice(i interface{}) []bool
ToBoolSlice casts an interface to a []bool type.
func ToBoolSliceE ¶
ToBoolSliceE casts an interface to a []bool type.
func ToDuration ¶
ToDuration casts an interface to a time.Duration type.
func ToDurationE ¶
ToDurationE casts an interface to a time.Duration type.
func ToDurationSlice ¶
ToDurationSlice casts an interface to a []time.Duration type.
func ToDurationSliceE ¶
ToDurationSliceE casts an interface to a []time.Duration type.
func ToFloat32 ¶
func ToFloat32(i interface{}) float32
ToFloat32 casts an interface to a float32 type.
func ToFloat32E ¶
ToFloat32E casts an interface to a float32 type.
func ToFloat64 ¶
func ToFloat64(i interface{}) float64
ToFloat64 casts an interface to a float64 type.
func ToFloat64E ¶
ToFloat64E casts an interface to a float64 type.
func ToIntSlice ¶
func ToIntSlice(i interface{}) []int
ToIntSlice casts an interface to a []int type.
func ToIntSliceE ¶
ToIntSliceE casts an interface to a []int type.
func ToSlice ¶
func ToSlice(i interface{}) []interface{}
ToSlice casts an interface to a []interface{} type.
func ToSliceE ¶
func ToSliceE(i interface{}) ([]interface{}, error)
ToSliceE casts an interface to a []interface{} type.
func ToStringMap ¶
func ToStringMap(i interface{}) map[string]interface{}
ToStringMap casts an interface to a map[string]interface{} type.
func ToStringMapBool ¶
ToStringMapBool casts an interface to a map[string]bool type.
func ToStringMapBoolE ¶
ToStringMapBoolE casts an interface to a map[string]bool type.
func ToStringMapE ¶
ToStringMapE casts an interface to a map[string]interface{} type.
func ToStringMapInt ¶
ToStringMapInt casts an interface to a map[string]int type.
func ToStringMapInt64 ¶
ToStringMapInt64 casts an interface to a map[string]int64 type.
func ToStringMapInt64E ¶
ToStringMapInt64E casts an interface to a map[string]int64{} type.
func ToStringMapIntE ¶
ToStringMapIntE casts an interface to a map[string]int{} type.
func ToStringMapString ¶
ToStringMapString casts an interface to a map[string]string type.
func ToStringMapStringE ¶
ToStringMapStringE casts an interface to a map[string]string type.
func ToStringMapStringSlice ¶
ToStringMapStringSlice casts an interface to a map[string][]string type.
func ToStringMapStringSliceE ¶
ToStringMapStringSliceE casts an interface to a map[string][]string type.
func ToStringSlice ¶
func ToStringSlice(i interface{}) []string
ToStringSlice casts an interface to a []string type.
func ToStringSliceE ¶
ToStringSliceE casts an interface to a []string type.
func UnescapeString ¶
func UnescapeString(v interface{}) string
func UnixTimeFormatDate ¶
func UnixTimeFormatDate(str interface{}) string
func VersionCompare ¶
VersionCompare version_compare() The possible operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively. special version strings these are handled in the following order, (any string not found) < dev < alpha = a < beta = b < RC = rc < # < pl = p Usage: VersionCompare("1.2.3-alpha", "1.2.3RC7", '>=') VersionCompare("1.2.3-beta", "1.2.3pl", 'lt') VersionCompare("1.1_dev", "1.2any", 'eq')
func ZhCharToPinyin ¶ added in v1.6.11
ZhCharToPinyin 将中文转换成小写字母
Types ¶
type URL ¶ added in v1.1.22
type URL struct { Scheme string Opaque string // encoded opaque data User *url.Userinfo // username and password information Host string // host or host:port Path string // path (relative paths may omit leading slash) RawPath string // encoded path hint (see EscapedPath method) ForceQuery bool // append a query ('?') even if RawQuery is empty RawQuery string // encoded query values, without '?' Fragment string // fragment for references, without '#' HostName string Port string // contains filtered or unexported fields }
URL wrap url.URL.
func ParseURLRaw ¶ added in v1.1.22
ParseURLRaw parses raw into URL.
func (*URL) Query ¶ added in v1.1.22
Query parses RawQuery and returns the corresponding values. It silently discards malformed value pairs. To check errors use ParseQuery.
func (*URL) QueryBool ¶ added in v1.1.22
QueryBool returns provided field's value in bool if value is empty, expect returns
func (*URL) QueryDuration ¶ added in v1.1.22
QueryDuration returns provided field's value in duration type. if value is empty, expect returns
func (*URL) QueryInt ¶ added in v1.1.22
QueryInt returns provided field's value in int type. if value is empty, expect returns
func (*URL) QueryInt64 ¶ added in v1.1.22
QueryInt64 returns provided field's value in int64 type. if value is empty, expect returns
func (*URL) QueryString ¶ added in v1.1.22
QueryString returns provided field's value in string type. if value is empty, expect returns