Documentation
¶
Index ¶
Examples ¶
Constants ¶
View Source
const DomainExample = "example.com"
DomainExample is "example.com" domain name.
Variables ¶
View Source
var Females = Names{}/* 10702 elements not displayed */
View Source
var LastNames = Names{}/* 500 elements not displayed */
View Source
var Males = Names{}/* 2537 elements not displayed */
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator is context for gimei generator.
func New ¶
func New() *Generator
New function returns Generator instance.
Example ¶
package main
import (
"fmt"
"github.com/goark/gimei-cli/gimei"
"github.com/goark/mt/mt19937"
)
func main() {
gen := gimei.New().WithRandSource(mt19937.New(19650218)).WithGenderOther(true).WithUnique(true)
for i := 0; i < 15; i++ {
fmt.Println(gen.New())
}
}
Output: 宮原 比呂志 (ミヤハラ ヒロシ : 男性) 小島 麗夏 (コジマ レイナ : 女性) 中川 温彦 (ナカガワ アツヒコ : 男性) 渋谷 範久 (シブヤ ノリヒサ : 男性) 奥村 櫂斗 (オクムラ カイト : 男性) 田島 由惠 (タジマ ヨシエ : 女性) 寺田 歩武 (テラダ アユム : 男性) 上野 謙一 (ウエノ ケンイチ : 男性) 村瀬 殊莉 (ムラセ コトリ : 女性) 荒川 望叶 (アラカワ ミカ : 女性) 福永 美妙 (フクナガ ミサ : 女性) 下村 智浩 (シモムラ トモヒロ : 男性) 小谷 水希 (コタニ ミキ : その他) 今井 氷魚 (イマイ ヒオ : 男性) 桑原 草太 (クワハラ ソウタ : その他)
func (*Generator) WithGenderOther ¶
WithGenderOther methos sets other flag.
func (*Generator) WithRandSource ¶
WithRandSource method sets rand.Source.
func (*Generator) WithUnique ¶
WithUnique method sets unique flag.
type Gimei ¶
Gimei is pseudo personal name (gimei) information.
func NewGimei ¶
NewGimei function returns new Gimei instance.
Example ¶
package main
import (
"fmt"
"github.com/goark/gimei-cli/gimei"
"github.com/goark/mt/mt19937"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
func main() {
fmt.Println(gimei.NewGimei(mt19937.New(19650218), gimei.Male))
fg := gimei.NewGimei(mt19937.New(19650218), gimei.Female)
fmt.Println(fg.FullName().Name)
fmt.Println(fg.FullName().Katakana)
fmt.Println(fg.FullName().Hiragana)
fmt.Println(cases.Title(language.Und, cases.NoLower).String(fg.FullName().Roman))
fmt.Println(fg.Email())
}
Output: 菊池 貴志 (キクチ タカシ : 男性) 菊池友美 キクチトモミ きくちともみ Kikuchi Tomomi t.kikuchi@example.com
func (*Gimei) EmailWithDomain ¶
EmailWithDomain method returns email address with the domain name.
func (*Gimei) FullNameWithSep ¶
FullNameWithSep method returns full name of gimei with the separator.
Click to show internal directories.
Click to hide internal directories.