Documentation
¶
Overview ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
Index ¶
- func Bin2Hex(src []byte) (out string)
- func BoolToFlag(source bool) (target string)
- func DecAdd(source string, add string) (target string, err error)
- func DecCmp(s1 string, s2 string) int
- func DecCrop(str string) string
- func DecExpand(str string, size int) string
- func DecSignToDec(decSign byte) (dec byte)
- func DecTest() (err error)
- func FlagToBool(source string) (target bool)
- func FloatToStr(source float64) (target string)
- func FormatAmount(amount, currencyName, dotSign string) (amountFormated string, err error)
- func FormatAmountTest() (err error)
- func GetRandHex(size int) (str string, err error)
- func GetRandRange(min int64, max int64) (rnd int64)
- func GetRandUUID() (randUUID string, err error)
- func GetRandСhance(percent int) (chance bool)
- func GetUnixmicrotimeUtc() (unixmicrotimeUtc string)
- func GetUnixmicrotimeUtcInt64() (unixmicrotimeUtc int64)
- func GetUnixnanotimeUtc() (unixnanotimeUtc string)
- func GetUnixnanotimeUtcInt64() (unixnanotimeUtc int64)
- func GetValueSint(r *http.Request, key string, defaultValue int64) (value int64)
- func GetValueStr(r *http.Request, key string, defaultValue string) (value string)
- func GetValueStrList(r *http.Request, key string, defaultValue []string) (value []string)
- func GetValueUint(r *http.Request, key string, defaultValue uint64) (value uint64)
- func Hex2Bin(src string) (dst []byte, err error)
- func HexAdd(source string, add string) (target string, err error)
- func HexCmp(s1 string, s2 string) int
- func HexCrop(str string) string
- func HexExpand(str string, size int) string
- func HexParity(str string) string
- func HexSignToDec(hexSign byte) (dec byte)
- func HexTest() (err error)
- func HttpDelete(url string, pHeaderMap *map[string]string, timeout time.Duration) (httpCode int, dataOut []byte, err error)
- func HttpGet(url string, pHeaderMap *map[string]string, timeout time.Duration) (httpCode int, dataOut []byte, err error)
- func HttpPost(url string, pHeaderMap *map[string]string, timeout time.Duration, ...) (httpCode int, dataOut []byte, err error)
- func HttpPut(url string, pHeaderMap *map[string]string, timeout time.Duration, ...) (httpCode int, dataOut []byte, err error)
- func IsDec(str string) (isDec bool)
- func IsDecSign(val byte) (isDec bool)
- func IsDockerContainer() (flagDocker bool)
- func IsFloat(str string, flagNeedDot bool) (flagOk bool)
- func IsFloatStrEqual(floatStr1 string, floatStr2 string) (flagEqual bool, err error)
- func IsHex(str string) (isHex bool)
- func IsHexSign(val byte) (isHex bool)
- func IsInt64InArray(arr []int64, val int64) bool
- func IsIsoDatetime(dateStr string) (flagOk bool)
- func IsParity(val uint64) bool
- func IsSint(str string) (flagOk bool)
- func IsStringInArray(arr []string, val string) bool
- func IsUint(str string) (flagOk bool)
- func IsUint64InArray(arr []uint64, val uint64) bool
- func IsoToUnixnanotime(iso string) (unixnanotime int64, err error)
- func LuhnCheck(val string) (flagOk bool)
- func LuhnMake(str string) (a string, flagOk bool)
- func LuhnTest() (err error)
- func Ping() string
- func Pong() string
- func PostBodyStr(r *http.Request, defaultValue string) (value string)
- func PostJsonValueStr(body string, key string, defaultValue string) (value string)
- func PostJsonValueStrList(body string, key string, defaultValue []string) (value []string)
- func PostParse(r *http.Request) (err error)
- func PostParseMultipart(r *http.Request, maxMemory int64) (err error)
- func PostValueFile(r *http.Request, key string, defaultValue []byte) (filename string, value []byte)
- func PostValueSint(r *http.Request, key string, defaultValue int64) (value int64)
- func PostValueStr(r *http.Request, key string, defaultValue string) (value string)
- func PostValueUint(r *http.Request, key string, defaultValue uint64) (value uint64)
- func SetByteInString(str string, index int, val byte) string
- func SintToStr(value int64) (str string)
- func StrExpandLeft(source string, size int, filler string) (target string)
- func StrExpandRight(source string, size int, filler string) (target string)
- func StrToFloat(str string) (value float64, err error)
- func StrToSint(str string) (value int64, err error)
- func StrToUint(str string) (value uint64, err error)
- func StringArrayToString(source []string) (target string)
- func SubByte(buf []byte, start_index int, size int) []byte
- func SubByteTest() (err error)
- func SubStr(buf string, start_index int, size int) string
- func TimeCropPerDay(source time.Time) (target time.Time)
- func UintToStr(value uint64) (str string)
- func Uniq(source []string) (target []string)
- func UnixmicrotimeStrToIso(unixmicrotimeStr string, offset int64, flagNanoseconds bool) (iso string)
- func UnixmicrotimeToIso(unixmicrotime int64, offset int64, flagNanoseconds bool) (iso string)
- func UnixmicrotimeToUnixmillitime(unixmicrotime int64) (unixmillitime int64)
- func UnixmicrotimeToUnixnanotime(unixmicrotime int64) (unixnanotime int64)
- func UnixmillitimeToUnixmicrotime(unixmillitime int64) (unixmicrotime int64)
- func UnixmillitimeToUnixtime(unixmillitime int64) (unixtime int64)
- func UnixnanotimeCropPerDay(unixnanotimeSource int64) (unixnanotimeTarget int64)
- func UnixnanotimePack(pTime *Time) (unixnanotime int64)
- func UnixnanotimeStrToIso(unixnanotimeStr string, offset int64, flagNanoseconds bool) (iso string)
- func UnixnanotimeToIso(unixnanotime int64, offset int64, flagNanoseconds bool) (iso string)
- func UnixnanotimeToUnixmicrotime(unixnanotime int64) (unixmicrotime int64)
- func UnixnanotimeUnpack(unixnanotime int64, pTime *Time)
- func UnixtimeStrToIso(unixtimeStr string, offset int64, flagNanoseconds bool) (iso string)
- func UnixtimeToIso(unixtime int64, offset int64, flagNanoseconds bool) (iso string)
- func UnixtimeToUnixmillitime(unixtime int64) (unixmillitime int64)
- func UrlAddParam(url string, key string, value string) (urlNew string)
- func UrlAddSlash(url string) (urlNew string)
- type Currency
- type Result
- func (p *Result) Draw1() string
- func (p *Result) Draw2() string
- func (p *Result) Draw3() string
- func (p *Result) GetCurentFileName() string
- func (p *Result) GetCurentFunctionName() string
- func (p *Result) GetCurentLine() int
- func (p *Result) GetErrMsg() string
- func (p *Result) GetErrNum() int
- func (p *Result) GetParentFileName() string
- func (p *Result) GetParentFunctionName() string
- func (p *Result) GetParentLine() int
- func (p *Result) GetPlace(stackPosition int) (functionName string, fileName string, line int)
- func (p *Result) Init()
- func (p *Result) IsErr() bool
- func (p *Result) IsOk() bool
- func (p *Result) SetErr(err error)
- func (p *Result) SetErrMsg(errNum int, errMsg string)
- func (p *Result) SetOk()
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bin2Hex ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func BoolToFlag ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func DecAdd ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func DecCmp ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
DecCmp() returns an integer indicating the result of the comparison, as follows: • 0, if the s1 and s2 are equal; • a negative value if s1 is less than s2; • a positive value if s1 is greater than s2.
func DecCrop ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func DecExpand ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func DecSignToDec ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func DecTest ¶
func DecTest() (err error)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func FlagToBool ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func FloatToStr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func FormatAmount ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// *
- @author Alexey Potehin <gnuplanet@gmail.com>, http://www.gnuplanet.online/doc/cv
- @brief format amount, example: 1 -> 0.01 for USD
- @param amount amount of coins, example: 100 is 1 dollar
- @param currencyName name of currency (ISO4217)
- @param dotSign separator, example: .
- @return amountFormated formated amount
- @return err error
func FormatAmountTest ¶
func FormatAmountTest() (err error)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetRandHex ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetRandRange ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetRandUUID ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetRandСhance ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// if event will be 80% then %80 times return true else false
func GetUnixmicrotimeUtc ¶
func GetUnixmicrotimeUtc() (unixmicrotimeUtc string)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetUnixmicrotimeUtcInt64 ¶
func GetUnixmicrotimeUtcInt64() (unixmicrotimeUtc int64)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetUnixnanotimeUtc ¶
func GetUnixnanotimeUtc() (unixnanotimeUtc string)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetUnixnanotimeUtcInt64 ¶
func GetUnixnanotimeUtcInt64() (unixnanotimeUtc int64)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetValueSint ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetValueStr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetValueStrList ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetValueUint ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func Hex2Bin ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func HexAdd ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func HexCmp ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
HexCmp() returns an integer indicating the result of the comparison, as follows: • 0, if the s1 and s2 are equal; • a negative value if s1 is less than s2; • a positive value if s1 is greater than s2.
func HexCrop ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func HexExpand ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func HexParity ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func HexSignToDec ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func HexTest ¶
func HexTest() (err error)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func HttpDelete ¶
func HttpDelete(url string, pHeaderMap *map[string]string, timeout time.Duration) (httpCode int, dataOut []byte, err error)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// *
- @author Alexey Potehin <gnuplanet@gmail.com>, http://www.gnuplanet.online/doc/cv
- @brief send DELETE request to url
- @param url URL
- @param pHeaderMap header map, map[string]string{"Content-Type": "application/json", "Authorization": "Bearer xxx"}
- @param timeout timeout like 30 * time.Second
- @return httpCode http status code
- @return dataOut received data
- @return err error
func HttpGet ¶
func HttpGet(url string, pHeaderMap *map[string]string, timeout time.Duration) (httpCode int, dataOut []byte, err error)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// *
- @author Alexey Potehin <gnuplanet@gmail.com>, http://www.gnuplanet.online/doc/cv
- @brief send GET request to url
- @param accessToken access token OR empty string
- @param url URL
- @param pHeaderMap header map, map[string]string{"Content-Type": "application/json", "Authorization": "Bearer xxx"}
- @param timeout timeout like 30 * time.Second
- @return httpCode http status code
- @return dataOut received data
- @return err error
func HttpPost ¶
func HttpPost(url string, pHeaderMap *map[string]string, timeout time.Duration, dataIn []byte) (httpCode int, dataOut []byte, err error)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// *
- @author Alexey Potehin <gnuplanet@gmail.com>, http://www.gnuplanet.online/doc/cv
- @brief send POST request to url
- @param accessToken access token OR empty string
- @param url URL
- @param pHeaderMap header map, map[string]string{"Content-Type": "application/json", "Authorization": "Bearer xxx"}
- @param timeout timeout like 30 * time.Second
- @param dataIn data for send
- @return httpCode http status code
- @return dataOut received data
- @return err error
func HttpPut ¶
func HttpPut(url string, pHeaderMap *map[string]string, timeout time.Duration, dataIn []byte) (httpCode int, dataOut []byte, err error)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// *
- @author Alexey Potehin <gnuplanet@gmail.com>, http://www.gnuplanet.online/doc/cv
- @brief send PUT request to url
- @param accessToken access token OR empty string
- @param url URL
- @param pHeaderMap header map, map[string]string{"Content-Type": "application/json", "Authorization": "Bearer xxx"}
- @param timeout timeout like 30 * time.Second
- @param dataIn data for send
- @return httpCode http status code
- @return dataOut received data
- @return err error
func IsDec ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsDecSign ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsDockerContainer ¶
func IsDockerContainer() (flagDocker bool)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsFloat ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// import (
"errors"
) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
"" - false "1" - true (for flagNeedDot == false) or false (for flagNeedDot == true) ".1" - true "1." - true "." - false ".1." - false "x" - false
func IsFloatStrEqual ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1 err 1 2 false 1 1 true 1 1. true 1 1.0 true 1 1.00 true
func IsHex ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsHexSign ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsInt64InArray ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsIsoDatetime ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsParity ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsSint ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsStringInArray ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsUint ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsUint64InArray ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func IsoToUnixnanotime ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// "2025-03-16T02:01:57+03:00" -> 1742079717000000000 (2025-03-15 23:01:57 +0000 UTC)
func LuhnCheck ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func LuhnMake ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func LuhnTest ¶
func LuhnTest() (err error)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func Ping ¶
func Ping() string
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func Pong ¶
func Pong() string
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func PostBodyStr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func PostJsonValueStr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func PostJsonValueStrList ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func PostParse ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func PostParseMultipart ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func PostValueFile ¶
func PostValueFile(r *http.Request, key string, defaultValue []byte) (filename string, value []byte)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func MPostValueStr(r *http.Request, key string, defaultValue string) (value string) { var err error if len(r.Form) == 0 { err = r.ParseMultipartForm(1024 * 1024 * 10) if err != nil { value = defaultValue return } }
// value = r.PostForm.Get(key)
value = r.Form.Get(key)
// tmp := r.URL.Query()[key] // if (len(tmp) == 0) { // value = defaultValue // return // } // value = tmp[0]
return }
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func MPostValueUint(r *http.Request, key string, defaultValue uint64) (value uint64) { var err error valueStr := MPostValueStr(r, key, fmt.Sprintf("%d", defaultValue)) if IsUint(valueStr) == false { value = defaultValue return } valueTmp, err := strconv.ParseUint(valueStr, 10, 64) if err != nil { value = defaultValue return } value = uint64(valueTmp) return }
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func MPostValueSint(r *http.Request, key string, defaultValue int64) (value int64) { var err error valueStr := MPostValueStr(r, key, fmt.Sprintf("%d", defaultValue)) if IsSint(valueStr) == false { value = defaultValue return } valueTmp, err := strconv.ParseInt(valueStr, 10, 64) if err != nil { value = defaultValue return } value = int64(valueTmp) return }
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func PostValueSint ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func PostValueStr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func PostValueUint ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func SetByteInString ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func SintToStr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func StrExpandLeft ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func StrExpandRight ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func StrToFloat ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func StrToSint ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func StrToUint ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func StringArrayToString ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func SubByte ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// [9 8 7 6 5 4 3 2 1], 0, 20 -> [9 8 7 6 5 4 3 2 1] [9 8 7 6 5 4 3 2 1], 0, 9 -> [9 8 7 6 5 4 3 2 1] [9 8 7 6 5 4 3 2 1], 0, 8 -> [9 8 7 6 5 4 3 2] [9 8 7 6 5 4 3 2 1], 1, 8 -> [8 7 6 5 4 3 2 1] [9 8 7 6 5 4 3 2 1], 2, 8 -> [7 6 5 4 3 2 1] [9 8 7 6 5 4 3 2 1], 2, 9 -> [7 6 5 4 3 2 1] [9 8 7 6 5 4 3 2 1], 2, -1 -> [7 6 5 4 3 2 1]
func SubByteTest ¶
func SubByteTest() (err error)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func SubStr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func TimeCropPerDay ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UintToStr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func Uniq ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UnixmicrotimeStrToIso ¶
func UnixmicrotimeStrToIso(unixmicrotimeStr string, offset int64, flagNanoseconds bool) (iso string)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// "1624120658256315" -> "2021-06-19 16:37:38.256315000" Obsolete: func Unixmicrotime_str2iso(unixmicrotime_str string) (iso string) {
func UnixmicrotimeToIso ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// 1624120658256315 -> "2021-06-19 16:37:38.256315000" Obsolete: func Unixmicrotime2iso(unixmicrotime int64) (iso string) {
func UnixmicrotimeToUnixmillitime ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UnixmicrotimeToUnixnanotime ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UnixmillitimeToUnixmicrotime ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UnixmillitimeToUnixtime ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UnixnanotimeCropPerDay ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UnixnanotimePack ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UnixnanotimeStrToIso ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// "1624120658256315911" -> "2021-06-19 16:37:38.256315911" Obsolete: func Unixnanotime_str2iso(unixnanotime_str string) (iso string) {
func UnixnanotimeToIso ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// 1624120658256315911 -> "2021-06-19 16:37:38.256315911" Obsolete: func Unixnanotime2iso(unixnanotime int64) (iso string) {
func UnixnanotimeToUnixmicrotime ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UnixnanotimeUnpack ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UnixtimeStrToIso ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// "1624120658" -> "2021-06-19 16:37:38.000000000" Obsolete: func Unixtime_str2iso(unixtime_str string) (iso string) {
func UnixtimeToIso ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// 1624120658 -> "2021-06-19 16:37:38.000000000" Obsolete: func Unixtime2iso(unixtime int64) (iso string) {
func UnixtimeToUnixmillitime ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UrlAddParam ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func UrlAddSlash ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
Types ¶
type Currency ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func GetCurrency ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// *
- @author Alexey Potehin <gnuplanet@gmail.com>, http://www.gnuplanet.online/doc/cv
- @brief get currency
- @param currencyName name of currency (ISO4217)
- @return currency currency
- @return err error
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) Draw1 ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) Draw2 ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) Draw3 ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) GetCurentFileName ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) GetCurentFunctionName ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) GetCurentLine ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) GetErrMsg ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) GetErrNum ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) GetParentFileName ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) GetParentFunctionName ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) GetParentLine ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) GetPlace ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) Init ¶
func (p *Result) Init()
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) IsErr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) IsOk ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) SetErr ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) SetErrMsg ¶
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
func (*Result) SetOk ¶
func (p *Result) SetOk()
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
type Time ¶
type Time struct { Year int Month int Day int Hour int Minute int Second int Nanosecond int WeekDay int }
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
Source Files
¶
- Bin2Hex.go
- BoolToFlag.go
- Currency.go
- FlagToBool.go
- FloatToStr.go
- GetRandHex.go
- GetRandRange.go
- GetRandUUID.go
- GetRandСhance.go
- Hex.go
- Hex2Bin.go
- HttpDelete.go
- HttpGet.go
- HttpPost.go
- HttpPut.go
- IsDockerContainer.go
- IsFloat.go
- IsFloatStrEqual.go
- IsInt64InArray.go
- IsIsoDatetime.go
- IsParity.go
- IsSint.go
- IsStringInArray.go
- IsUint.go
- IsUint64InArray.go
- Isotime.go
- Luhn.go
- SintToStr.go
- StrExpandLeft.go
- StrExpandRight.go
- StrToFloat.go
- StrToSint.go
- StrToUint.go
- StringArrayToString.go
- UintToStr.go
- Uniq.go
- UrlAddParam.go
- UrlAddSlash.go
- other.go
- param.go
- ping.go
- pong.go
- result.go
- usetest.go