-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathcompany.go
53 lines (41 loc) · 1.17 KB
/
company.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package faker
import "fmt"
type FakeCompany interface {
Name() string // => "Aufderhar LLC"
Suffix() string // => "Inc"
CatchPhrase() string // => "Universal logistical artificial intelligence"
Bs() string // => "engage distributed applications"
Ein() string // => "58-6520513"
DunsNumber() string // => "16-708-2968"
Logo() string // => "http://www.biz-logo.com/examples/015.gif"
String() string // String is an alias for Name.
}
type fakeCompany struct{}
func Company() FakeCompany {
return fakeCompany{}
}
func (c fakeCompany) Name() string {
return Fetch("company.name")
}
func (c fakeCompany) Suffix() string {
return Fetch("company.suffix")
}
func (c fakeCompany) CatchPhrase() string {
return Fetch("company.buzzwords")
}
func (c fakeCompany) Bs() string {
return Fetch("company.bs")
}
func (c fakeCompany) Ein() string {
return Numerify("##-#######")
}
func (c fakeCompany) DunsNumber() string {
return Numerify("##-###-####")
}
func (c fakeCompany) Logo() string {
n := RandomInt(1, 77)
return fmt.Sprintf("http://www.biz-logo.com/examples/%03d.gif", n)
}
func (c fakeCompany) String() string {
return c.Name()
}