Documentation ¶
Index ¶
- Constants
- Variables
- func BoolToString(b bool) string
- func BytesToString(b []byte) string
- func CreateRand() *rand.Rand
- func CreateRandomBytes(n uint32) []byte
- func CreateRandomString(n uint32) string
- func CustomCobraHelp() func(*cobra.Command, []string)
- func CustomCobraUsage() func(*cobra.Command) error
- func Float64ToString(f float64) string
- func GetRandIdBase64() string
- func GetRandIdBytes() []byte
- func GetRandIdInt64() int64
- func GetRandIdIntBytes() [8]byte
- func GetRandIdString() string
- func Int64ToString(n int64) string
- func Int64ToTimeDuration(value int64) time.Duration
- func PrettyCobraHelpAndUsage(c *cobra.Command)
- func RemoveDuplicatesAndEmptyS(o []string) (ret []string)
- func SetApplicationName(name string)
- func StringToBytes(s string) []byte
- func StringToFloat64(s string) (float64, error)
- func StringToInt64(s string) (int64, error)
- func StringToUint64(s string) (uint64, error)
- func TimeDurationToInt64(duration time.Duration) int64
- func TruncateDecimal(value float64, n uint16) float64
- func TruncateDecimal4(value float64) float64
- func Uint64ToString(n uint64) string
Constants ¶
View Source
const ( ConstDefaultPrometheusNamespace = "okboost" ConstDefaultPrometheusSubsystemName = "" )
Variables ¶
View Source
var ApplicationName = "default"
Functions ¶
func BoolToString ¶
func CreateRand ¶
func CreateRandomString ¶
func CustomCobraHelp ¶
func CustomCobraUsage ¶
func Float64ToString ¶
func GetRandIdBase64 ¶
func GetRandIdBase64() string
func GetRandIdBytes ¶
func GetRandIdBytes() []byte
func GetRandIdInt64 ¶
func GetRandIdInt64() int64
func GetRandIdIntBytes ¶
func GetRandIdIntBytes() [8]byte
func GetRandIdString ¶
func GetRandIdString() string
func Int64ToString ¶
func Int64ToTimeDuration ¶
func PrettyCobraHelpAndUsage ¶
func RemoveDuplicatesAndEmptyS ¶
[]string 内元素 Remove Duplicate
func SetApplicationName ¶
func SetApplicationName(name string)
func StringToFloat64 ¶
func StringToInt64 ¶
func StringToUint64 ¶
func TimeDurationToInt64 ¶
func TruncateDecimal ¶
func TruncateDecimal4 ¶
TruncateDecimal4 uint 代表小数位数,格式位 0.000001 如果是几位就指定为几位
func Uint64ToString ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.