Documentation ¶
Index ¶
- Constants
- func Address() string
- func Amount(min, max float64, decimal uint, prefix string) string
- func BankCardNumber(issuer string) string
- func Classify(option ClassifyOption) string
- func Date(from, to time.Time) time.Time
- func Domain(level uint) string
- func Elements[T any](arr []T, num uint) []T
- func Email() string
- func Float32(min, max float32, decimal uint) (float32, error)
- func Float64(min, max float64, decimal uint) (float64, error)
- func FormatDate(from, to time.Time, layout string) string
- func GitBranch() string
- func GitCommitSha() string
- func GitCommitShortSha() string
- func Hex(alpha bool) string
- func HslArray() [3]float32
- func HslStr(style string) string
- func HslaArray() [4]float32
- func HslaStr(style string) string
- func HttpMethod() string
- func HttpStatusCode() int
- func Id() string
- func Int(min, max int) (int, error)
- func IntBy(digit uint, positive bool) (int, error)
- func Ipv4() string
- func Ipv6() string
- func Landline() string
- func Letter(lang string) string
- func LongAndLat(format string) [2]string
- func MD5() string
- func Mobile() string
- func MobileHideMiddle() string
- func Month(lang string, abbr bool) string
- func Name(lang string, upper bool) string
- func Paragraph(num uint, lang string) string
- func Password(length uint, strength string) string
- func Picsum(option PicsumOption) string
- func Placeholder(option PlaceholderOption) (string, error)
- func Protocol() string
- func RgbArray() [3]int
- func RgbStr(style string) string
- func RgbaArray() [4]float32
- func RgbaStr(style string) string
- func Sentence(num uint, lang string) string
- func SimpleClassify() string
- func SimplePicsum() string
- func SimplePlaceholder() string
- func SimpleUrl() string
- func Str(length uint) string
- func StrBy(length uint, source string) string
- func Timestamp(from, to time.Time, format string) int
- func Tld() (tld, tldType string)
- func UUID() string
- func Uint(min, max uint) (uint, error)
- func Url(option UrlOption) string
- func Version() string
- func Vin() string
- func Vrm() string
- func Week(lang string, abbr bool) string
- func Word(num uint, lang string) string
- func ZipCode() int
- type AddressBase
- type ClassifyOption
- type Hsl
- type PicsumOption
- type PlaceholderOption
- type Size
- type UrlOption
Constants ¶
const ( Visa = "visa" Amex = "amex" Jcb = "jcb" MasterCard = "mastercard" UnionPay = "unionpay" )
Variables ¶
This section is empty.
Functions ¶
func Address ¶
func Address() string
return a random Chinese Mainland address string that include province, city and county, separated by space
func BankCardNumber ¶
return a random bank card number. support Visa, Amex, Jcb, MasterCard and UnionPay card issuer
func FormatDate ¶
return a format date via layout
func HslArray ¶
func HslArray() [3]float32
return a random hsl color array. saturation and lightness will be decimal between 0 and 1(present percent)
func HslaArray ¶
func HslaArray() [4]float32
return a random hsla color array. saturation and lightness will be decimal between 0 and 1(present percent)
func LongAndLat ¶
return a random longitude and latitude array. support deg format and dms format
func MobileHideMiddle ¶
func MobileHideMiddle() string
return a 11-digit Mainland China hidden middle 4-digit mobile number
func Picsum ¶
func Picsum(option PicsumOption) string
return a random image from unSplash by special param struct
func Placeholder ¶
func Placeholder(option PlaceholderOption) (string, error)
return a random placeholder image with pure color background with special struct
func SimplePicsum ¶
func SimplePicsum() string
return a random image. simple use of Picsum without params
func SimplePlaceholder ¶
func SimplePlaceholder() string
return a random placeholder image without params
func SimpleUrl ¶
func SimpleUrl() string
return a random url without params. if you want to set please use Url
func Timestamp ¶
return a random timestamp support second millisecond and nanosecond via format param
func Url ¶
return a random url via the option struct
type UrlOption struct { SubDir uint layers of sub-directory,default is between [1,4] Protocol string protocol of url,default is random Suffix string suffix of the url, such as .com, .org,default is random DomainLevel uint level of sub domain, default is between [1,3] }