aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/icrowley/fake/internet.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-05 22:03:19 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-05 22:33:03 +0100
commit1d4bb7ceb0cef79d68df0bacc913b01e40e6ddd6 (patch)
treee088b0fa43058afde1db71541d8fcb4b94905d6e /vendor/github.com/icrowley/fake/internet.go
parentf093be96e98284580d61664adecd0a2ff8b354e4 (diff)
downloadgit-bug-1d4bb7ceb0cef79d68df0bacc913b01e40e6ddd6.tar.gz
migrate to go modules
Diffstat (limited to 'vendor/github.com/icrowley/fake/internet.go')
-rw-r--r--vendor/github.com/icrowley/fake/internet.go77
1 files changed, 0 insertions, 77 deletions
diff --git a/vendor/github.com/icrowley/fake/internet.go b/vendor/github.com/icrowley/fake/internet.go
deleted file mode 100644
index 8fd1c273..00000000
--- a/vendor/github.com/icrowley/fake/internet.go
+++ /dev/null
@@ -1,77 +0,0 @@
-package fake
-
-import (
- "net"
- "strings"
-
- "github.com/corpix/uarand"
-)
-
-// UserName generates user name in one of the following forms
-// first name + last name, letter + last names or concatenation of from 1 to 3 lowercased words
-func UserName() string {
- gender := randGender()
- switch r.Intn(3) {
- case 0:
- return lookup("en", gender+"_first_names", false) + lookup(lang, gender+"_last_names", false)
- case 1:
- return Character() + lookup(lang, gender+"_last_names", false)
- default:
- return strings.Replace(WordsN(r.Intn(3)+1), " ", "_", -1)
- }
-}
-
-// TopLevelDomain generates random top level domain
-func TopLevelDomain() string {
- return lookup(lang, "top_level_domains", true)
-}
-
-// DomainName generates random domain name
-func DomainName() string {
- return Company() + "." + TopLevelDomain()
-}
-
-// EmailAddress generates email address
-func EmailAddress() string {
- return UserName() + "@" + DomainName()
-}
-
-// EmailSubject generates random email subject
-func EmailSubject() string {
- return Sentence()
-}
-
-// EmailBody generates random email body
-func EmailBody() string {
- return Paragraphs()
-}
-
-// DomainZone generates random domain zone
-func DomainZone() string {
- return lookup(lang, "domain_zones", true)
-}
-
-// IPv4 generates IPv4 address
-func IPv4() string {
- size := 4
- ip := make([]byte, size)
- for i := 0; i < size; i++ {
- ip[i] = byte(r.Intn(256))
- }
- return net.IP(ip).To4().String()
-}
-
-// IPv6 generates IPv6 address
-func IPv6() string {
- size := 16
- ip := make([]byte, size)
- for i := 0; i < size; i++ {
- ip[i] = byte(r.Intn(256))
- }
- return net.IP(ip).To16().String()
-}
-
-// UserAgent generates a random user agent.
-func UserAgent() string {
- return uarand.GetRandom()
-}