Go library which provides tools for generating arbitrary data.
Go to file
Charles Iliya Krempeaux 1f5dcd5b8a pct-encoded 2024-08-26 15:15:24 -07:00
LICENSE changelog.ca -> reiver.link 2024-08-25 05:25:02 -07:00
README.md sourcecode.social -> github.com 2024-08-25 05:35:51 -07:00
default.go pct-encoded 2024-08-26 15:15:24 -07:00
doc.go initial commit 2015-01-29 00:45:50 -08:00
go.mod go.* 2024-08-25 05:36:05 -07:00
go.sum go.* 2024-08-25 05:36:05 -07:00
languages.go password 2021-11-22 16:10:46 -08:00
passwords.go password 2021-11-22 15:40:19 -08:00
t.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_bool.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_bool_test.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_htmlfile.go sourcecode.social -> github.com 2024-08-25 05:35:51 -07:00
t_netaddr.go network port 2022-12-14 06:38:54 -08:00
t_netport.go network port 2022-12-14 06:36:14 -08:00
t_password.go password 2021-11-22 16:07:34 -08:00
t_pctencoded.go pct-encoded 2024-08-25 05:47:26 -07:00
t_phonenumber.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_10thoframadan.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_alexandria.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_arish.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_aswan.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_asyut.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_benha.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_benisuef.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_canada.go phone number 2021-11-21 08:27:42 -08:00
t_phonenumber_damanhur.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_damietta.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_egypt.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_egypt_3_4.go phone number 2021-11-22 08:56:28 -08:00
t_phonenumber_egypt_4_4.go phone number 2021-11-22 08:56:28 -08:00
t_phonenumber_eltor.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_faiyum.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_greatercairo.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_ismailia.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_kafrelsheikh.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_luxor.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_mansoura.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_marsamatruh.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_minya.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_monufia.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_newvalley.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_portsaid.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_qalyubia.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_qena.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_redsea.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_sohag.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_suez.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_tanta.go phone number 2021-11-22 08:48:48 -08:00
t_phonenumber_zagazig.go phone number 2021-11-22 08:48:48 -08:00
t_regularfile.go fs.File regular-file 2022-12-14 06:16:55 -08:00
t_runes.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_runes_test.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_string.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_string_test.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_textfile.go sourcecode.social -> github.com 2024-08-25 05:35:51 -07:00
words_english.go password 2021-11-22 16:07:34 -08:00
words_korean.go password 2021-11-22 16:07:34 -08:00
words_spanish.go password 2021-11-22 16:10:46 -08:00

README.md

go-arbitrary

go-arbitrary is a Go library which provides tools for generating arbitrary data.

Example

Here is a typical example:

// Generate an arbitrary phonenumber.
phoneNumber := arbitrary.PhoneNumber()

// Generate an arbitrary bool.
// Might be false, might be true.
bl := arbitrary.Bool()

// Generate an arbitrary string.
s := arbitrary.String()

Or if you want to provide your own souce of randomness:

src := rand.NewSource( time.Now().UTC().UnixNano() )
arb := arbitrary.New(src)

// Generate an arbitrary phonenumber.
phoneNumber := arb.PhoneNumber()

// Generate an arbitrary bool.
// Might be false, might be true.
bl := arb.Bool()

// Generate an arbitrary string.
s := arb.String()

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-arbitrary

GoDoc