Documentation ¶
Index ¶
- func Address(conn *sql.DB) map[string]string
- func AddressColumns(conn *sql.DB, columns ...string) []map[string]string
- func Age() string
- func AirPort3Code() string
- func AirPort4Code() string
- func AirPortCity() string
- func AirPortCityPinyin() string
- func AirPortInfo() map[string]string
- func AirPortName() string
- func AirlineInfo() map[string]string
- func AirlineName() string
- func AreaCode(langs ...string) string
- func BS() string
- func BirthDay() string
- func BuzzWord() string
- func CarBrand(langs ...string) string
- func ChromeUserAgent() string
- func CityCode() string
- func Color(langs ...string) string
- func Company() (company string)
- func CompanySuffix() string
- func ConnectSqlite(dbPath string) (*sql.DB, error)
- func CreateConn(dbPath string) *sql.DB
- func Date() time.Time
- func DateRange(start, end time.Time) time.Time
- func Day() int
- func DeviceID() string
- func DomainName() string
- func DomainSuffix() string
- func Email() string
- func FirefoxUserAgent() string
- func FirstName(langs ...string) string
- func Float32() float32
- func Float64() float64
- func Gender(langs ...string) string
- func HTTPMethod() string
- func Hour() int
- func IMID() string
- func IPv4Address() string
- func IPv6Address() string
- func IdCard() string
- func Imei() string
- func Imsi() string
- func Int16() int16
- func Int32() int32
- func Int64() int64
- func Int8() int8
- func Job(langs ...string) string
- func LastName(langs ...string) string
- func Letter() string
- func Lexify(str string) string
- func Luhn(preNumArr []int) int
- func MacAddress(sep string, letterType bool) string
- func Meid(letterType bool) string
- func Minute() int
- func MobilePhone(langs ...string) string
- func Month() string
- func Name(langs ...string) string
- func NanoSecond() int
- func NickName() string
- func NowDate() string
- func NowTimeStamp() string
- func Number(min int, max int) int
- func Numerify(str string) string
- func OperaUserAgent() string
- func PassWord(lower bool, upper bool, numeric bool, special bool, space bool, length int) string
- func QuerySqlite(conn *sql.DB, querySql string, args ...interface{}) ([]map[string]string, error)
- func RandBool(a []bool) bool
- func RandMacAddress() string
- func RandMeid() string
- func RandString(a []string) string
- func SafariUserAgent() string
- func SeatOfFlight() string
- func SeatOfTrain() string
- func Second() int
- func Seed(seed int64)
- func ShuffleInts(a []int)
- func ShuffleStrings(a []string)
- func SpecialTellPhone() string
- func TelPhone(langs ...string) string
- func TrainTripis() string
- func URL() string
- func Uint16() uint16
- func Uint32() uint32
- func Uint64() uint64
- func Uint8() uint8
- func UserAgent() string
- func UserName() string
- func Voyage() string
- func WebSite() string
- func WeekDay() string
- func Year() int
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChromeUserAgent ¶
func ChromeUserAgent() string
ChromeUserAgent will generate a random chrome browser user agent string
Example ¶
Seed(11) fmt.Println(ChromeUserAgent())
Output: Mozilla/5.0 (X11; Linux i686) AppleWebKit/5312 (KHTML, like Gecko) Chrome/39.0.836.0 Mobile Safari/5312
func CompanySuffix ¶
func CompanySuffix() string
CompanySuffix will generate a random company suffix string
func ConnectSqlite ¶
返回数据库连接, 若成功第二个参数为空字符串, 否则第二个参数为报错信息
func CreateConn ¶
func Date ¶
Date will generate a random time.Time struct
Example ¶
Seed(11) fmt.Println(Date())
Output: 1989-01-07 04:14:25.685339029 +0000 UTC
func DateRange ¶
DateRange will generate a random time.Time struct between a start and end date
Example ¶
Seed(11) fmt.Println(DateRange(time.Unix(0, 484633944473634951), time.Unix(0, 1431318744473668209))) // May 10, 1985 years to May 10, 2015
Output: 2012-02-04 14:10:37.166933216 +0000 UTC
func Day ¶
func Day() int
Day will generate a random day between 1 - 31
Example ¶
Seed(11) fmt.Println(Day())
Output: 12
func DeviceID ¶
func DeviceID() string
//采集设备ID、固定21位、前9位为安全厂商ID(如FIBERHOME),后12位为采集设备MAC,规则同MAC、所有字母大写
func FirefoxUserAgent ¶
func FirefoxUserAgent() string
FirefoxUserAgent will generate a random firefox broswer user agent string
Example ¶
Seed(11) fmt.Println(FirefoxUserAgent())
Output: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_8_3 rv:7.0) Gecko/1989-07-01 Firefox/37.0
func Float32 ¶
func Float32() float32
Float32 will generate a random float32 value
Example ¶
Seed(11) fmt.Println(Float32())
Output: 3.1128167e+37
func Float64 ¶
func Float64() float64
Float64 will generate a random float64 value
Example ¶
Seed(11) fmt.Println(Float64())
Output: 1.644484108270445e+307
func Hour ¶
func Hour() int
Hour will generate a random hour - in military time
Example ¶
Seed(11) fmt.Println(Hour())
Output: 0
func IPv4Address ¶
func IPv4Address() string
IPv4Address will generate a random version 4 ip address
func IPv6Address ¶
func IPv6Address() string
IPv6Address will generate a random version 6 ip address
func Imsi ¶
func Imsi() string
IMSI是15位的十进制数, 结构为: MCC + MNC + MSIN 国内为460开头、<=15、纯数字(国内一般为15位,国际规范为不超过15位) 暂时只做国内的
func Int16 ¶
func Int16() int16
Int16 will generate a random int16 value
Example ¶
Seed(11) fmt.Println(Int16())
Output: 2200
func Int32 ¶
func Int32() int32
Int32 will generate a random int32 value
Example ¶
Seed(11) fmt.Println(Int32())
Output: -1072427943
func Int64 ¶
func Int64() int64
Int64 will generate a random int64 value
Example ¶
Seed(11) fmt.Println(Int64())
Output: -8379641344161477543
func Int8 ¶
func Int8() int8
Int8 will generate a random Int8 value
Example ¶
Seed(11) fmt.Println(Int8())
Output: 24
func Letter ¶
func Letter() string
Letter will generate a single random lower case letter
Example ¶
Seed(11) fmt.Println(Letter())
Output: g
func Lexify ¶
Lexify will replace ? will random generated letters
Example ¶
Seed(11) fmt.Println(Lexify("?????"))
Output: gbrma
func MacAddress ¶
MacAddress will generate a random mac address 根据sep确定分隔符返回, letterType=true返回大写字母, false返回小写字母
func Meid ¶
MEID(CDMA网络):固定14位,16进制,数字+[A-F]或[a-f],例子:A000008C057C13 letterType=true返回大写字母, false返回小写字母
func Minute ¶
func Minute() int
Minute will generate a random minute
Example ¶
Seed(11) fmt.Println(Minute())
Output: 0
func Month ¶
func Month() string
Month will generate a random month string
Example ¶
Seed(11) fmt.Println(Month())
Output: January
func NanoSecond ¶
func NanoSecond() int
NanoSecond will generate a random nano second
Example ¶
Seed(11) fmt.Println(NanoSecond())
Output: 196446360
func Number ¶
Number will generate a random number between given min And max
Example ¶
Seed(11) fmt.Println(Number(50, 23456))
Output: 14866
func Numerify ¶
Numerify will replace # with random numerical values
Example ¶
Seed(11) fmt.Println(Numerify("###-###-####"))
Output: 328-727-1570
func OperaUserAgent ¶
func OperaUserAgent() string
OperaUserAgent will generate a random opera browser user agent string
Example ¶
Seed(11) fmt.Println(OperaUserAgent())
Output: Opera/8.39 (Macintosh; U; PPC Mac OS X 10_8_7; en-US) Presto/2.9.335 Version/10.00
func QuerySqlite ¶
执行查询SQL, 返回查询结果
func RandString ¶
RandString will take in a slice of string and return a randomly selected value
func SafariUserAgent ¶
func SafariUserAgent() string
SafariUserAgent will generate a random safari browser user agent string
Example ¶
Seed(11) fmt.Println(SafariUserAgent())
Output: Mozilla/5.0 (iPad; CPU OS 8_3_2 like Mac OS X; en-US) AppleWebKit/531.15.6 (KHTML, like Gecko) Version/4.0.5 Mobile/8B120 Safari/6531.15.6
func SeatOfFlight ¶
func SeatOfFlight() string
func SeatOfTrain ¶
func SeatOfTrain() string
func Second ¶
func Second() int
Second will generate a random second
Example ¶
Seed(11) fmt.Println(Second())
Output: 0
func ShuffleInts ¶
func ShuffleInts(a []int)
ShuffleInts will randomize a slice of ints
Example ¶
Seed(11) ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657} ShuffleInts(ints) fmt.Println(ints)
Output: [74125 777 941 89416 8413 854 52 841657]
func ShuffleStrings ¶
func ShuffleStrings(a []string)
ShuffleStrings will randomize a slice of strings
Example ¶
Seed(11) strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"} ShuffleStrings(strings) fmt.Println(strings)
Output: [everyone a for good have times happy day]
func TrainTripis ¶
func TrainTripis() string
func Uint16 ¶
func Uint16() uint16
Uint16 will generate a random uint16 value
Example ¶
Seed(11) fmt.Println(Uint16())
Output: 34968
func Uint32 ¶
func Uint32() uint32
Uint32 will generate a random uint32 value
Example ¶
Seed(11) fmt.Println(Uint32())
Output: 1075055705
func Uint64 ¶
func Uint64() uint64
Uint64 will generate a random uint64 value
Example ¶
Seed(11) fmt.Println(Uint64())
Output: 843730692693298265
func Uint8 ¶
func Uint8() uint8
Uint8 will generate a random uint8 value
Example ¶
Seed(11) fmt.Println(Uint8())
Output: 152
func UserAgent ¶
func UserAgent() string
UserAgent will generate a random broswer user agent
Example ¶
Seed(11) fmt.Println(UserAgent())
Output: Mozilla/5.0 (Windows NT 5.0) AppleWebKit/5362 (KHTML, like Gecko) Chrome/37.0.834.0 Mobile Safari/5362
func UserName ¶
func UserName() string
Username will genrate a random username based upon picking a random lastname and random numbers at the end
Types ¶
This section is empty.