utils

package
v0.0.0-...-63964f8 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToString

func BoolToString(b bool) string

func IDToSting

func IDToSting(id int64) string

func LinkID

func LinkID(a, b int64) string

func LinkStr

func LinkStr(a, b string) string

func ParseLinkID

func ParseLinkID(str string) (a, b int64)

func RandomArea

func RandomArea() string

func RandomEmail

func RandomEmail() string

func RandomFloat

func RandomFloat(min, max float64) float64

RandomFloat 返回min到max之间的一个随机小数

func RandomInt

func RandomInt(min, max int64) int64

RandomInt 返回min到max之间的一个随机数

func RandomOwner

func RandomOwner() string

RandomOwner RandomString(6)

func RandomPeriod

func RandomPeriod() time.Time

RandomPeriod 随机时间点

func RandomString

func RandomString(n int) string

RandomString 生成一个长度为n的随机字符串

func RandomStringSlice

func RandomStringSlice(maxLength int, eleMaxLength int) []string

RandomStringSlice 指定最大切片长度和切片中元素长度的随机字符串切片

func RandomTag

func RandomTag() string

func StringToBoolMust

func StringToBoolMust(s string) bool

func StringToIDMust

func StringToIDMust(id string) int64

Types

type StrTo

type StrTo string

func (StrTo) Int

func (s StrTo) Int() (int, error)

func (StrTo) Int32

func (s StrTo) Int32() (int32, error)

func (StrTo) Int64

func (s StrTo) Int64() (int64, error)

func (StrTo) MustInt

func (s StrTo) MustInt() int

func (StrTo) MustInt32

func (s StrTo) MustInt32() int32

func (StrTo) MustInt64

func (s StrTo) MustInt64() int64

func (StrTo) MustUInt32

func (s StrTo) MustUInt32() uint32

func (StrTo) String

func (s StrTo) String() string

func (StrTo) UInt32

func (s StrTo) UInt32() (uint32, error)

Jump to

Keyboard shortcuts

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